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

Private Attributes

std::vector< int > AuxTSvec_
 
bool correctTiming_
 
DetId::Detector det_
 
bool dropZSmarkedPassed_
 
HBHETimeProfileStatusBitSetterhbheHSCPFlagSetter_
 
HBHETimingShapedFlagSetterhbheTimingShapedFlagSetter_
 
HcalHFStatusBitFromDigishfdigibit_
 
HcalHFStatusBitFromRecHitshfrechitbit_
 
HFTimingTrustFlagHFTimingTrustFlagSetter_
 
double lowGainFrac_
 
int lowGainOffset_
 
HcalLongRecoParamsmyobject
 
ZdcSimpleRecAlgo reco_
 
HcalADCSaturationFlagsaturationFlagSetter_
 
bool setHSCPFlags_
 
bool setNoiseFlags_
 
bool setSaturationFlags_
 
bool setTimingTrustFlags_
 
int subdet_
 
HcalOtherSubdetector subdetOther_
 
HcalTopologytheTopology
 
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 35 of file ZdcHitReconstructor.h.

Constructor & Destructor Documentation

◆ ZdcHitReconstructor()

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

Definition at line 18 of file ZdcHitReconstructor.cc.

19  : reco_(conf.getParameter<bool>("correctForTimeslew"),
20  conf.getParameter<bool>("correctForPhaseContainment"),
21  conf.getParameter<double>("correctionPhaseNS"),
22  conf.getParameter<int>("recoMethod"),
23  conf.getParameter<int>("lowGainOffset"),
24  conf.getParameter<double>("lowGainFrac")),
25  saturationFlagSetter_(nullptr),
26  HFTimingTrustFlagSetter_(nullptr),
27  hbheHSCPFlagSetter_(nullptr),
29  hfrechitbit_(nullptr),
30  hfdigibit_(nullptr),
32  correctTiming_(conf.getParameter<bool>("correctTiming")),
33  setNoiseFlags_(conf.getParameter<bool>("setNoiseFlags")),
34  setHSCPFlags_(conf.getParameter<bool>("setHSCPFlags")),
35  setSaturationFlags_(conf.getParameter<bool>("setSaturationFlags")),
36  setTimingTrustFlags_(conf.getParameter<bool>("setTimingTrustFlags")),
37  dropZSmarkedPassed_(conf.getParameter<bool>("dropZSmarkedPassed")),
38  AuxTSvec_(conf.getParameter<std::vector<int> >("AuxTSvec")),
39  myobject(nullptr),
40  theTopology(nullptr)
41 
42 {
43  tok_input_hcal = consumes<ZDCDigiCollection>(conf.getParameter<edm::InputTag>("digiLabelhcal"));
44  tok_input_castor = consumes<ZDCDigiCollection>(conf.getParameter<edm::InputTag>("digiLabelcastor"));
45 
46  std::sort(AuxTSvec_.begin(), AuxTSvec_.end()); // sort vector in ascending TS order
47  std::string subd = conf.getParameter<std::string>("Subdetector");
48 
49  if (setSaturationFlags_) {
50  const edm::ParameterSet& pssat = conf.getParameter<edm::ParameterSet>("saturationParameters");
51  saturationFlagSetter_ = new HcalADCSaturationFlag(pssat.getParameter<int>("maxADCvalue"));
52  }
53  if (!strcasecmp(subd.c_str(), "ZDC")) {
54  det_ = DetId::Calo;
56  produces<ZDCRecHitCollection>();
57  } else if (!strcasecmp(subd.c_str(), "CALIB")) {
60  produces<HcalCalibRecHitCollection>();
61  } else {
62  std::cout << "ZdcHitReconstructor is not associated with a specific subdetector!" << std::endl;
63  }
64 }

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

◆ ~ZdcHitReconstructor()

ZdcHitReconstructor::~ZdcHitReconstructor ( )
override

Definition at line 66 of file ZdcHitReconstructor.cc.

66 { delete saturationFlagSetter_; }

References saturationFlagSetter_.

Member Function Documentation

◆ beginRun()

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

◆ endRun()

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

Definition at line 79 of file ZdcHitReconstructor.cc.

79  {
80  delete myobject;
81  myobject = nullptr;
82  delete theTopology;
83  theTopology = nullptr;
84 }

References myobject, and theTopology.

◆ produce()

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

Definition at line 85 of file ZdcHitReconstructor.cc.

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

References AuxTSvec_, edm::SortedCollection< T, SORT >::begin(), AlignmentProducer_cff::calibrations, DetId::Calo, det_, HcalSeverityLevelComputer::dropChannel(), dropZSmarkedPassed_, MillePedeFileConverter_cfg::e, edm::SortedCollection< T, SORT >::empty(), edm::SortedCollection< T, SORT >::end(), edm::EventSetup::get(), get, HcalDbService::getHcalCalibrations(), HcalDbService::getHcalCoder(), HcalDbService::getHcalShape(), HcalChannelStatus::getValue(), HcalCondObjectContainer< Item >::getValues(), mps_fire::i, edm::HandleBase::isValid(), eostools::move(), myobject, HcalLongRecoParam::noiseTS(), AlCaHLTBitMon_ParallelJobs::p, edm::ESHandle< T >::product(), DetId::rawId(), reco_, ZdcSimpleRecAlgo::reconstruct(), saturationFlagSetter_, HcalADCSaturationFlag::setSaturationFlag(), setSaturationFlags_, 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 65 of file ZdcHitReconstructor.h.

Referenced by produce(), and ZdcHitReconstructor().

◆ correctTiming_

bool ZdcHitReconstructor::correctTiming_
private

Definition at line 58 of file ZdcHitReconstructor.h.

◆ det_

DetId::Detector ZdcHitReconstructor::det_
private

Definition at line 52 of file ZdcHitReconstructor.h.

Referenced by produce(), and ZdcHitReconstructor().

◆ dropZSmarkedPassed_

bool ZdcHitReconstructor::dropZSmarkedPassed_
private

Definition at line 64 of file ZdcHitReconstructor.h.

Referenced by produce().

◆ hbheHSCPFlagSetter_

HBHETimeProfileStatusBitSetter* ZdcHitReconstructor::hbheHSCPFlagSetter_
private

Definition at line 47 of file ZdcHitReconstructor.h.

◆ hbheTimingShapedFlagSetter_

HBHETimingShapedFlagSetter* ZdcHitReconstructor::hbheTimingShapedFlagSetter_
private

Definition at line 48 of file ZdcHitReconstructor.h.

◆ hfdigibit_

HcalHFStatusBitFromDigis* ZdcHitReconstructor::hfdigibit_
private

Definition at line 50 of file ZdcHitReconstructor.h.

◆ hfrechitbit_

HcalHFStatusBitFromRecHits* ZdcHitReconstructor::hfrechitbit_
private

Definition at line 49 of file ZdcHitReconstructor.h.

◆ HFTimingTrustFlagSetter_

HFTimingTrustFlag* ZdcHitReconstructor::HFTimingTrustFlagSetter_
private

Definition at line 46 of file ZdcHitReconstructor.h.

◆ lowGainFrac_

double ZdcHitReconstructor::lowGainFrac_
private

Definition at line 68 of file ZdcHitReconstructor.h.

◆ lowGainOffset_

int ZdcHitReconstructor::lowGainOffset_
private

Definition at line 67 of file ZdcHitReconstructor.h.

◆ myobject

HcalLongRecoParams* ZdcHitReconstructor::myobject
private

Definition at line 70 of file ZdcHitReconstructor.h.

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

◆ reco_

ZdcSimpleRecAlgo ZdcHitReconstructor::reco_
private

Definition at line 44 of file ZdcHitReconstructor.h.

Referenced by produce().

◆ saturationFlagSetter_

HcalADCSaturationFlag* ZdcHitReconstructor::saturationFlagSetter_
private

Definition at line 45 of file ZdcHitReconstructor.h.

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

◆ setHSCPFlags_

bool ZdcHitReconstructor::setHSCPFlags_
private

Definition at line 60 of file ZdcHitReconstructor.h.

◆ setNoiseFlags_

bool ZdcHitReconstructor::setNoiseFlags_
private

Definition at line 59 of file ZdcHitReconstructor.h.

◆ setSaturationFlags_

bool ZdcHitReconstructor::setSaturationFlags_
private

Definition at line 61 of file ZdcHitReconstructor.h.

Referenced by produce(), and ZdcHitReconstructor().

◆ setTimingTrustFlags_

bool ZdcHitReconstructor::setTimingTrustFlags_
private

Definition at line 62 of file ZdcHitReconstructor.h.

◆ subdet_

int ZdcHitReconstructor::subdet_
private

Definition at line 53 of file ZdcHitReconstructor.h.

Referenced by produce(), and ZdcHitReconstructor().

◆ subdetOther_

HcalOtherSubdetector ZdcHitReconstructor::subdetOther_
private

Definition at line 54 of file ZdcHitReconstructor.h.

Referenced by ZdcHitReconstructor().

◆ theTopology

HcalTopology* ZdcHitReconstructor::theTopology
private

Definition at line 71 of file ZdcHitReconstructor.h.

Referenced by beginRun(), and endRun().

◆ tok_input_castor

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

Definition at line 56 of file ZdcHitReconstructor.h.

Referenced by produce(), and ZdcHitReconstructor().

◆ tok_input_hcal

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

Definition at line 55 of file ZdcHitReconstructor.h.

Referenced by produce(), and ZdcHitReconstructor().

HcalOther
Definition: HcalAssistant.h:38
ZdcHitReconstructor::setHSCPFlags_
bool setHSCPFlags_
Definition: ZdcHitReconstructor.h:60
edm::ESHandle::product
T const * product() const
Definition: ESHandle.h:86
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
HcalCondObjectContainerBase::setTopo
void setTopo(const HcalTopology *topo)
Definition: HcalCondObjectContainerBase.cc:17
ZdcHitReconstructor::hbheTimingShapedFlagSetter_
HBHETimingShapedFlagSetter * hbheTimingShapedFlagSetter_
Definition: ZdcHitReconstructor.h:48
HcalLongRecoParam::noiseTS
std::vector< unsigned int > noiseTS() const
Definition: HcalLongRecoParam.h:27
ZdcHitReconstructor::dropZSmarkedPassed_
bool dropZSmarkedPassed_
Definition: ZdcHitReconstructor.h:64
ZdcHitReconstructor::reco_
ZdcSimpleRecAlgo reco_
Definition: ZdcHitReconstructor.h:44
HcalChannelQualityRcd
Definition: HcalChannelQualityRcd.h:8
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::LogInfo
Definition: MessageLogger.h:254
edm::SortedCollection::size
size_type size() const
Definition: SortedCollection.h:215
ZdcHitReconstructor::HFTimingTrustFlagSetter_
HFTimingTrustFlag * HFTimingTrustFlagSetter_
Definition: ZdcHitReconstructor.h:46
AlignmentProducer_cff.calibrations
calibrations
Definition: AlignmentProducer_cff.py:59
HcalChannelQuality
Definition: HcalChannelQuality.h:17
edm::Handle
Definition: AssociativeIterator.h:50
ZdcHitReconstructor::theTopology
HcalTopology * theTopology
Definition: ZdcHitReconstructor.h:71
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
ZdcHitReconstructor::myobject
HcalLongRecoParams * myobject
Definition: ZdcHitReconstructor.h:70
edm::SortedCollection::begin
const_iterator begin() const
Definition: SortedCollection.h:262
HcalChannelStatus
Definition: HcalChannelStatus.h:13
HcalSeverityLevelComputer
Definition: HcalSeverityLevelComputer.h:24
edm::ESHandle
Definition: DTSurvey.h:22
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
ZdcHitReconstructor::hbheHSCPFlagSetter_
HBHETimeProfileStatusBitSetter * hbheHSCPFlagSetter_
Definition: ZdcHitReconstructor.h:47
HcalCalibrations
Definition: HcalCalibrations.h:9
HcalRecNumberingRecord
Definition: HcalRecNumberingRecord.h:23
ZdcHitReconstructor::hfdigibit_
HcalHFStatusBitFromDigis * hfdigibit_
Definition: ZdcHitReconstructor.h:50
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:65
HcalChannelStatus::getValue
uint32_t getValue() const
Definition: HcalChannelStatus.h:60
edm::ParameterSet
Definition: ParameterSet.h:36
ZdcHitReconstructor::correctTiming_
bool correctTiming_
Definition: ZdcHitReconstructor.h:58
HcalADCSaturationFlag
Definition: HcalADCSaturationFlag.h:23
edm::SortedCollection::end
const_iterator end() const
Definition: SortedCollection.h:267
ZdcHitReconstructor::setSaturationFlags_
bool setSaturationFlags_
Definition: ZdcHitReconstructor.h:61
ZdcHitReconstructor::hfrechitbit_
HcalHFStatusBitFromRecHits * hfrechitbit_
Definition: ZdcHitReconstructor.h:49
HcalLongRecoParam
Definition: HcalLongRecoParam.h:15
ZdcHitReconstructor::det_
DetId::Detector det_
Definition: ZdcHitReconstructor.h:52
get
#define get
ZdcHitReconstructor::subdet_
int subdet_
Definition: ZdcHitReconstructor.h:53
HcalLongRecoParam::signalTS
std::vector< unsigned int > signalTS() const
Definition: HcalLongRecoParam.h:26
HcalQIECoder
Definition: HcalQIECoder.h:20
ZdcHitReconstructor::saturationFlagSetter_
HcalADCSaturationFlag * saturationFlagSetter_
Definition: ZdcHitReconstructor.h:45
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
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:56
HcalQIEShape
Definition: HcalQIEShape.h:17
HcalCoderDb
Definition: HcalCoderDb.h:15
HcalLongRecoParams
Definition: HcalLongRecoParams.h:9
HcalDbRecord
Definition: HcalDbRecord.h:30
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
ZdcHitReconstructor::setNoiseFlags_
bool setNoiseFlags_
Definition: ZdcHitReconstructor.h:59
edm::InputTag
Definition: InputTag.h:15
HcalSeverityLevelComputerRcd
Definition: HcalSeverityLevelComputerRcd.h:23
geometryCSVtoXML.xx
xx
Definition: geometryCSVtoXML.py:19
ZdcHitReconstructor::setTimingTrustFlags_
bool setTimingTrustFlags_
Definition: ZdcHitReconstructor.h:62
ZdcHitReconstructor::subdetOther_
HcalOtherSubdetector subdetOther_
Definition: ZdcHitReconstructor.h:54
ZdcHitReconstructor::tok_input_hcal
edm::EDGetTokenT< ZDCDigiCollection > tok_input_hcal
Definition: ZdcHitReconstructor.h:55
edm::SortedCollection::empty
bool empty() const
Definition: SortedCollection.h:210
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37