CMS 3D CMS Logo

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

#include <ZdcHitReconstructor.h>

Inheritance diagram for ZdcHitReconstructor:
edm::stream::EDProducer<>

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) final
 
 ZdcHitReconstructor (const edm::ParameterSet &ps)
 
 ~ZdcHitReconstructor () override
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 

Private Attributes

std::vector< int > AuxTSvec_
 
edm::ESGetToken< HcalDbService, HcalDbRecordconditionsToken_
 
bool correctTiming_
 
DetId::Detector det_
 
bool dropZSmarkedPassed_
 
edm::ESGetToken< HcalTopology, HcalRecNumberingRecordhtopoToken_
 
std::unique_ptr< HcalLongRecoParamslongRecoParams_
 
double lowGainFrac_
 
int lowGainOffset_
 
edm::ESGetToken< HcalLongRecoParams, HcalLongRecoParamsRcdparamsToken_
 
edm::ESGetToken< HcalChannelQuality, HcalChannelQualityRcdqualToken_
 
ZdcSimpleRecAlgo reco_
 
HcalADCSaturationFlagsaturationFlagSetter_
 
bool setHSCPFlags_
 
bool setNoiseFlags_
 
bool setSaturationFlags_
 
bool setTimingTrustFlags_
 
edm::ESGetToken< HcalSeverityLevelComputer, HcalSeverityLevelComputerRcdsevToken_
 
int subdet_
 
HcalOtherSubdetector subdetOther_
 
edm::EDGetTokenT< ZDCDigiCollectiontok_input_castor
 
edm::EDGetTokenT< ZDCDigiCollectiontok_input_hcal
 

Additional Inherited Members

- Public Types inherited from edm::stream::EDProducer<>
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

Author
E. Garcia - CSU Based on HcalSimpleReconstructor.h by J. Mans

Definition at line 46 of file ZdcHitReconstructor.h.

Constructor & Destructor Documentation

◆ ZdcHitReconstructor()

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

Definition at line 17 of file ZdcHitReconstructor.cc.

18  : reco_(conf.getParameter<bool>("correctForTimeslew"),
19  conf.getParameter<bool>("correctForPhaseContainment"),
20  conf.getParameter<double>("correctionPhaseNS"),
21  conf.getParameter<int>("recoMethod"),
22  conf.getParameter<int>("lowGainOffset"),
23  conf.getParameter<double>("lowGainFrac")),
24  saturationFlagSetter_(nullptr),
26  correctTiming_(conf.getParameter<bool>("correctTiming")),
27  setNoiseFlags_(conf.getParameter<bool>("setNoiseFlags")),
28  setHSCPFlags_(conf.getParameter<bool>("setHSCPFlags")),
29  setSaturationFlags_(conf.getParameter<bool>("setSaturationFlags")),
30  setTimingTrustFlags_(conf.getParameter<bool>("setTimingTrustFlags")),
31  dropZSmarkedPassed_(conf.getParameter<bool>("dropZSmarkedPassed")),
32  AuxTSvec_(conf.getParameter<std::vector<int> >("AuxTSvec")) {
33  tok_input_hcal = consumes<ZDCDigiCollection>(conf.getParameter<edm::InputTag>("digiLabelhcal"));
34  tok_input_castor = consumes<ZDCDigiCollection>(conf.getParameter<edm::InputTag>("digiLabelcastor"));
35 
36  std::sort(AuxTSvec_.begin(), AuxTSvec_.end()); // sort vector in ascending TS order
37  std::string subd = conf.getParameter<std::string>("Subdetector");
38 
39  if (setSaturationFlags_) {
40  const edm::ParameterSet& pssat = conf.getParameter<edm::ParameterSet>("saturationParameters");
41  saturationFlagSetter_ = new HcalADCSaturationFlag(pssat.getParameter<int>("maxADCvalue"));
42  }
43  if (!strcasecmp(subd.c_str(), "ZDC")) {
44  det_ = DetId::Calo;
46  produces<ZDCRecHitCollection>();
47  } else if (!strcasecmp(subd.c_str(), "CALIB")) {
50  produces<HcalCalibRecHitCollection>();
51  } else {
52  std::cout << "ZdcHitReconstructor is not associated with a specific subdetector!" << std::endl;
53  }
54 
55  // ES tokens
56  htopoToken_ = esConsumes<HcalTopology, HcalRecNumberingRecord, edm::Transition::BeginRun>();
57  paramsToken_ = esConsumes<HcalLongRecoParams, HcalLongRecoParamsRcd, edm::Transition::BeginRun>();
58  conditionsToken_ = esConsumes<HcalDbService, HcalDbRecord>();
59  qualToken_ = esConsumes<HcalChannelQuality, HcalChannelQualityRcd>(edm::ESInputTag("", "withTopo"));
60  sevToken_ = esConsumes<HcalSeverityLevelComputer, HcalSeverityLevelComputerRcd>();
61 }

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

◆ ~ZdcHitReconstructor()

ZdcHitReconstructor::~ZdcHitReconstructor ( )
override

Definition at line 63 of file ZdcHitReconstructor.cc.

63 { delete saturationFlagSetter_; }

References saturationFlagSetter_.

Member Function Documentation

◆ beginRun()

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

Definition at line 65 of file ZdcHitReconstructor.cc.

65  {
66  const HcalTopology& htopo = es.getData(htopoToken_);
67  const HcalLongRecoParams& p = es.getData(paramsToken_);
68  longRecoParams_ = std::make_unique<HcalLongRecoParams>(p);
69  longRecoParams_->setTopo(&htopo);
70 }

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

◆ endRun()

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

Definition at line 72 of file ZdcHitReconstructor.cc.

72 {}

◆ produce()

void ZdcHitReconstructor::produce ( edm::Event e,
const edm::EventSetup c 
)
final

Definition at line 74 of file ZdcHitReconstructor.cc.

74  {
75  // get conditions
76  const HcalDbService* conditions = &eventSetup.getData(conditionsToken_);
77  const HcalChannelQuality* myqual = &eventSetup.getData(qualToken_);
78  const HcalSeverityLevelComputer* mySeverity = &eventSetup.getData(sevToken_);
79 
80  // define vectors to pass noiseTS and signalTS
81  std::vector<unsigned int> mySignalTS;
82  std::vector<unsigned int> myNoiseTS;
83 
86  e.getByToken(tok_input_hcal, digi);
87 
88  if (digi->empty()) {
90  e.getByToken(tok_input_castor, digi_castor);
91  if (!digi_castor.isValid() || digi_castor->empty())
92  edm::LogInfo("ZdcHitReconstructor") << "No ZDC info found in either castorDigis or hcalDigis." << std::endl;
93  if (digi_castor.isValid())
94  e.getByToken(tok_input_castor, digi);
95  }
96 
97  // create empty output
98  auto rec = std::make_unique<ZDCRecHitCollection>();
99  rec->reserve(digi->size());
100  // run the algorithm
102  for (i = digi->begin(); i != digi->end(); i++) {
103  HcalZDCDetId cell = i->id();
104  DetId detcell = (DetId)cell;
105  // check on cells to be ignored and dropped: (rof,20.Feb.09)
106  const HcalChannelStatus* mydigistatus = myqual->getValues(detcell.rawId());
107  if (mySeverity->dropChannel(mydigistatus->getValue()))
108  continue;
110  if (i->zsMarkAndPass())
111  continue;
112  const HcalCalibrations& calibrations = conditions->getHcalCalibrations(cell);
113  const HcalQIECoder* channelCoder = conditions->getHcalCoder(cell);
114  const HcalQIEShape* shape = conditions->getHcalShape(channelCoder);
115  HcalCoderDb coder(*channelCoder, *shape);
116 
117  // get db values for signalTSs and noiseTSs
118  const HcalLongRecoParam* myParams = longRecoParams_->getValues(detcell);
119  mySignalTS.clear();
120  myNoiseTS.clear();
121  mySignalTS = myParams->signalTS();
122  myNoiseTS = myParams->noiseTS();
123 
124  rec->push_back(reco_.reconstruct(*i, myNoiseTS, mySignalTS, coder, calibrations));
125  (rec->back()).setFlags(0);
127  saturationFlagSetter_->setSaturationFlag(rec->back(), *i);
128 
129  // Set auxiliary flag with subset of digi information
130  // ZDC aux flag can store non-contiguous set of values
131  int auxflag = 0;
132  for (unsigned int xx = 0; xx < AuxTSvec_.size() && xx < 4; ++xx) {
133  if (AuxTSvec_[xx] < 0 || AuxTSvec_[xx] > 9)
134  continue; // don't allow
135  auxflag += (i->sample(AuxTSvec_[xx]).adc())
136  << (7 * xx); // store the time slices in the first 28 bits of aux, a set of 4 7-bit a dc values
137  }
138  // bits 28 and 29 are reserved for capid of the first time slice saved in aux
139  if (!AuxTSvec_.empty())
140  auxflag += ((i->sample(AuxTSvec_[0]).capid()) << 28);
141  (rec->back()).setAux(auxflag);
142  }
143  // return result
144  e.put(std::move(rec));
145  } // else if (det_==DetId::Calo...)
146 
147 } // void HcalHitReconstructor::produce(...)

References AuxTSvec_, edm::SortedCollection< T, SORT >::begin(), AlignmentProducer_cff::calibrations, DetId::Calo, submitPVValidationJobs::conditions, conditionsToken_, det_, HcalSeverityLevelComputer::dropChannel(), dropZSmarkedPassed_, MillePedeFileConverter_cfg::e, edm::SortedCollection< T, SORT >::empty(), edm::SortedCollection< T, SORT >::end(), edm::EventSetup::getData(), HcalChannelStatus::getValue(), HcalCondObjectContainer< Item >::getValues(), mps_fire::i, edm::HandleBase::isValid(), longRecoParams_, eostools::move(), HcalLongRecoParam::noiseTS(), qualToken_, DetId::rawId(), reco_, ZdcSimpleRecAlgo::reconstruct(), saturationFlagSetter_, HcalADCSaturationFlag::setSaturationFlag(), setSaturationFlags_, sevToken_, HcalLongRecoParam::signalTS(), edm::SortedCollection< T, SORT >::size(), subdet_, HcalZDCDetId::SubdetectorId, tok_input_castor, tok_input_hcal, and geometryCSVtoXML::xx.

Member Data Documentation

◆ AuxTSvec_

std::vector<int> ZdcHitReconstructor::AuxTSvec_
private

Definition at line 71 of file ZdcHitReconstructor.h.

Referenced by produce(), and ZdcHitReconstructor().

◆ conditionsToken_

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

Definition at line 82 of file ZdcHitReconstructor.h.

Referenced by produce(), and ZdcHitReconstructor().

◆ correctTiming_

bool ZdcHitReconstructor::correctTiming_
private

Definition at line 64 of file ZdcHitReconstructor.h.

◆ det_

DetId::Detector ZdcHitReconstructor::det_
private

Definition at line 58 of file ZdcHitReconstructor.h.

Referenced by produce(), and ZdcHitReconstructor().

◆ dropZSmarkedPassed_

bool ZdcHitReconstructor::dropZSmarkedPassed_
private

Definition at line 70 of file ZdcHitReconstructor.h.

Referenced by produce().

◆ htopoToken_

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

Definition at line 80 of file ZdcHitReconstructor.h.

Referenced by beginRun(), and ZdcHitReconstructor().

◆ longRecoParams_

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

Definition at line 77 of file ZdcHitReconstructor.h.

Referenced by beginRun(), and produce().

◆ lowGainFrac_

double ZdcHitReconstructor::lowGainFrac_
private

Definition at line 75 of file ZdcHitReconstructor.h.

◆ lowGainOffset_

int ZdcHitReconstructor::lowGainOffset_
private

Definition at line 74 of file ZdcHitReconstructor.h.

◆ paramsToken_

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

Definition at line 81 of file ZdcHitReconstructor.h.

Referenced by beginRun(), and ZdcHitReconstructor().

◆ qualToken_

edm::ESGetToken<HcalChannelQuality, HcalChannelQualityRcd> ZdcHitReconstructor::qualToken_
private

Definition at line 83 of file ZdcHitReconstructor.h.

Referenced by produce(), and ZdcHitReconstructor().

◆ reco_

ZdcSimpleRecAlgo ZdcHitReconstructor::reco_
private

Definition at line 55 of file ZdcHitReconstructor.h.

Referenced by produce().

◆ saturationFlagSetter_

HcalADCSaturationFlag* ZdcHitReconstructor::saturationFlagSetter_
private

Definition at line 56 of file ZdcHitReconstructor.h.

Referenced by produce(), ZdcHitReconstructor(), and ~ZdcHitReconstructor().

◆ setHSCPFlags_

bool ZdcHitReconstructor::setHSCPFlags_
private

Definition at line 66 of file ZdcHitReconstructor.h.

◆ setNoiseFlags_

bool ZdcHitReconstructor::setNoiseFlags_
private

Definition at line 65 of file ZdcHitReconstructor.h.

◆ setSaturationFlags_

bool ZdcHitReconstructor::setSaturationFlags_
private

Definition at line 67 of file ZdcHitReconstructor.h.

Referenced by produce(), and ZdcHitReconstructor().

◆ setTimingTrustFlags_

bool ZdcHitReconstructor::setTimingTrustFlags_
private

Definition at line 68 of file ZdcHitReconstructor.h.

◆ sevToken_

Definition at line 84 of file ZdcHitReconstructor.h.

Referenced by produce(), and ZdcHitReconstructor().

◆ subdet_

int ZdcHitReconstructor::subdet_
private

Definition at line 59 of file ZdcHitReconstructor.h.

Referenced by produce(), and ZdcHitReconstructor().

◆ subdetOther_

HcalOtherSubdetector ZdcHitReconstructor::subdetOther_
private

Definition at line 60 of file ZdcHitReconstructor.h.

Referenced by ZdcHitReconstructor().

◆ tok_input_castor

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

Definition at line 62 of file ZdcHitReconstructor.h.

Referenced by produce(), and ZdcHitReconstructor().

◆ tok_input_hcal

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

Definition at line 61 of file ZdcHitReconstructor.h.

Referenced by produce(), and ZdcHitReconstructor().

HcalOther
Definition: HcalAssistant.h:38
ZdcHitReconstructor::setHSCPFlags_
bool setHSCPFlags_
Definition: ZdcHitReconstructor.h:66
ZdcHitReconstructor::htopoToken_
edm::ESGetToken< HcalTopology, HcalRecNumberingRecord > htopoToken_
Definition: ZdcHitReconstructor.h:80
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
ZdcHitReconstructor::longRecoParams_
std::unique_ptr< HcalLongRecoParams > longRecoParams_
Definition: ZdcHitReconstructor.h:77
HcalLongRecoParam::noiseTS
std::vector< unsigned int > noiseTS() const
Definition: HcalLongRecoParam.h:27
ZdcHitReconstructor::dropZSmarkedPassed_
bool dropZSmarkedPassed_
Definition: ZdcHitReconstructor.h:70
ZdcHitReconstructor::reco_
ZdcSimpleRecAlgo reco_
Definition: ZdcHitReconstructor.h:55
AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
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
HcalChannelQuality
Definition: HcalChannelQuality.h:17
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
ZdcHitReconstructor::paramsToken_
edm::ESGetToken< HcalLongRecoParams, HcalLongRecoParamsRcd > paramsToken_
Definition: ZdcHitReconstructor.h:81
ZdcHitReconstructor::sevToken_
edm::ESGetToken< HcalSeverityLevelComputer, HcalSeverityLevelComputerRcd > sevToken_
Definition: ZdcHitReconstructor.h:84
DetId
Definition: DetId.h:17
HcalZDCDetId
Definition: HcalZDCDetId.h:16
edm::SortedCollection::begin
const_iterator begin() const
Definition: SortedCollection.h:262
HcalChannelStatus
Definition: HcalChannelStatus.h:13
HcalSeverityLevelComputer
Definition: HcalSeverityLevelComputer.h:24
HcalADCSaturationFlag::setSaturationFlag
void setSaturationFlag(HBHERecHit &rechit, const HBHEDataFrame &digi)
Definition: HcalADCSaturationFlag.cc:33
HcalCalibration
Definition: HcalAssistant.h:40
HcalZDCDetId::SubdetectorId
static const int SubdetectorId
Definition: HcalZDCDetId.h:25
HcalCalibrations
Definition: HcalCalibrations.h:9
ZdcHitReconstructor::conditionsToken_
edm::ESGetToken< HcalDbService, HcalDbRecord > conditionsToken_
Definition: ZdcHitReconstructor.h:82
HcalSeverityLevelComputer::dropChannel
bool dropChannel(const uint32_t &mystatus) const
Definition: HcalSeverityLevelComputer.cc:395
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
ZdcHitReconstructor::AuxTSvec_
std::vector< int > AuxTSvec_
Definition: ZdcHitReconstructor.h:71
HcalChannelStatus::getValue
uint32_t getValue() const
Definition: HcalChannelStatus.h:60
edm::ParameterSet
Definition: ParameterSet.h:47
ZdcHitReconstructor::correctTiming_
bool correctTiming_
Definition: ZdcHitReconstructor.h:64
HcalADCSaturationFlag
Definition: HcalADCSaturationFlag.h:23
edm::SortedCollection::end
const_iterator end() const
Definition: SortedCollection.h:267
ZdcHitReconstructor::setSaturationFlags_
bool setSaturationFlags_
Definition: ZdcHitReconstructor.h:67
ZdcHitReconstructor::qualToken_
edm::ESGetToken< HcalChannelQuality, HcalChannelQualityRcd > qualToken_
Definition: ZdcHitReconstructor.h:83
HcalLongRecoParam
Definition: HcalLongRecoParam.h:15
ZdcHitReconstructor::det_
DetId::Detector det_
Definition: ZdcHitReconstructor.h:58
ZdcHitReconstructor::subdet_
int subdet_
Definition: ZdcHitReconstructor.h:59
HcalLongRecoParam::signalTS
std::vector< unsigned int > signalTS() const
Definition: HcalLongRecoParam.h:26
HcalQIECoder
Definition: HcalQIECoder.h:20
ZdcHitReconstructor::saturationFlagSetter_
HcalADCSaturationFlag * saturationFlagSetter_
Definition: ZdcHitReconstructor.h:56
HcalDbService
Definition: HcalDbService.h:26
submitPVValidationJobs.conditions
list conditions
Definition: submitPVValidationJobs.py:674
eostools.move
def move(src, dest)
Definition: eostools.py:511
DetId::rawId
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
ZdcHitReconstructor::tok_input_castor
edm::EDGetTokenT< ZDCDigiCollection > tok_input_castor
Definition: ZdcHitReconstructor.h:62
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
HcalQIEShape
Definition: HcalQIEShape.h:17
HcalCoderDb
Definition: HcalCoderDb.h:15
HcalLongRecoParams
Definition: HcalLongRecoParams.h:9
edm::HandleBase::isValid
bool isValid() const
Definition: HandleBase.h:70
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
ZdcHitReconstructor::setNoiseFlags_
bool setNoiseFlags_
Definition: ZdcHitReconstructor.h:65
edm::InputTag
Definition: InputTag.h:15
geometryCSVtoXML.xx
xx
Definition: geometryCSVtoXML.py:19
ZdcHitReconstructor::setTimingTrustFlags_
bool setTimingTrustFlags_
Definition: ZdcHitReconstructor.h:68
ZdcHitReconstructor::subdetOther_
HcalOtherSubdetector subdetOther_
Definition: ZdcHitReconstructor.h:60
ZdcHitReconstructor::tok_input_hcal
edm::EDGetTokenT< ZDCDigiCollection > tok_input_hcal
Definition: ZdcHitReconstructor.h:61
edm::SortedCollection::empty
bool empty() const
Definition: SortedCollection.h:210
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37