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

Definition at line 18 of file ZdcHitReconstructor.cc.

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.

18  :
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 
50  {
51  const edm::ParameterSet& pssat = conf.getParameter<edm::ParameterSet>("saturationParameters");
52  saturationFlagSetter_ = new HcalADCSaturationFlag(pssat.getParameter<int>("maxADCvalue"));
53  }
54  if (!strcasecmp(subd.c_str(),"ZDC")) {
57  produces<ZDCRecHitCollection>();
58  } else if (!strcasecmp(subd.c_str(),"CALIB")) {
61  produces<HcalCalibRecHitCollection>();
62  } else {
63  std::cout << "ZdcHitReconstructor is not associated with a specific subdetector!" << std::endl;
64  }
65 
66 }
T getParameter(std::string const &) const
HcalTopology * theTopology
HBHETimeProfileStatusBitSetter * hbheHSCPFlagSetter_
HcalHFStatusBitFromDigis * hfdigibit_
edm::EDGetTokenT< ZDCDigiCollection > tok_input_hcal
ZdcSimpleRecAlgo reco_
HcalOtherSubdetector subdetOther_
HcalLongRecoParams * myobject
HcalADCSaturationFlag * saturationFlagSetter_
edm::EDGetTokenT< ZDCDigiCollection > tok_input_castor
static const int SubdetectorId
Definition: HcalZDCDetId.h:25
std::vector< int > AuxTSvec_
HcalHFStatusBitFromRecHits * hfrechitbit_
HBHETimingShapedFlagSetter * hbheTimingShapedFlagSetter_
HFTimingTrustFlag * HFTimingTrustFlagSetter_
ZdcHitReconstructor::~ZdcHitReconstructor ( )
override

Definition at line 68 of file ZdcHitReconstructor.cc.

References saturationFlagSetter_.

69 {
70  delete saturationFlagSetter_;
71 }
HcalADCSaturationFlag * saturationFlagSetter_

Member Function Documentation

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

Definition at line 86 of file ZdcHitReconstructor.cc.

References myobject, and theTopology.

86  {
87  delete myobject; myobject=nullptr;
88  delete theTopology; theTopology=nullptr;
89 }
HcalTopology * theTopology
HcalLongRecoParams * myobject
void ZdcHitReconstructor::produce ( edm::Event e,
const edm::EventSetup c 
)
final

Definition at line 90 of file ZdcHitReconstructor.cc.

References AuxTSvec_, edm::SortedCollection< T, SORT >::begin(), AlignmentProducer_cff::calibrations, DetId::Calo, det_, HcalSeverityLevelComputer::dropChannel(), dropZSmarkedPassed_, edm::SortedCollection< T, SORT >::empty(), edm::SortedCollection< T, SORT >::end(), edm::EventSetup::get(), edm::Event::getByToken(), 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(), edm::Event::put(), 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.

91 {
92  // get conditions
94  eventSetup.get<HcalDbRecord>().get(conditions);
95 
97  eventSetup.get<HcalChannelQualityRcd>().get("withTopo", p);
98  const HcalChannelQuality* myqual = p.product();
99 
101  eventSetup.get<HcalSeverityLevelComputerRcd>().get(mycomputer);
102  const HcalSeverityLevelComputer* mySeverity = mycomputer.product();
103 
104  // define vectors to pass noiseTS and signalTS
105  std::vector<unsigned int> mySignalTS;
106  std::vector<unsigned int> myNoiseTS;
107 
110  e.getByToken(tok_input_hcal,digi);
111 
112  if(digi->empty()) {
113  edm::Handle<ZDCDigiCollection> digi_castor;
114  e.getByToken(tok_input_castor,digi_castor);
115  if(!digi_castor.isValid() || digi_castor->empty())
116  edm::LogInfo("ZdcHitReconstructor") << "No ZDC info found in either castorDigis or hcalDigis." << std::endl;
117  if(digi_castor.isValid())
119  }
120 
121  // create empty output
122  auto rec = std::make_unique<ZDCRecHitCollection>();
123  rec->reserve(digi->size());
124  // run the algorithm
126  for (i=digi->begin(); i!=digi->end(); i++) {
127  HcalZDCDetId cell = i->id();
128  DetId detcell=(DetId)cell;
129  // check on cells to be ignored and dropped: (rof,20.Feb.09)
130  const HcalChannelStatus* mydigistatus=myqual->getValues(detcell.rawId());
131  if (mySeverity->dropChannel(mydigistatus->getValue() ) ) continue;
133  if (i->zsMarkAndPass()) continue;
134  const HcalCalibrations& calibrations=conditions->getHcalCalibrations(cell);
135  const HcalQIECoder* channelCoder = conditions->getHcalCoder (cell);
136  const HcalQIEShape* shape = conditions->getHcalShape (channelCoder);
137  HcalCoderDb coder (*channelCoder, *shape);
138 
139 // get db values for signalTSs and noiseTSs
140  const HcalLongRecoParam* myParams = myobject->getValues(detcell);
141  mySignalTS.clear();
142  myNoiseTS.clear();
143  mySignalTS = myParams->signalTS();
144  myNoiseTS = myParams->noiseTS();
145 
146  rec->push_back(reco_.reconstruct(*i,myNoiseTS,mySignalTS,coder,calibrations));
147  (rec->back()).setFlags(0);
149  saturationFlagSetter_->setSaturationFlag(rec->back(),*i);
150 
151  // Set auxiliary flag with subset of digi information
152  // ZDC aux flag can store non-contiguous set of values
153  int auxflag=0;
154  for (unsigned int xx=0; xx<AuxTSvec_.size() && xx<4;++xx)
155  {
156  if (AuxTSvec_[xx]<0 || AuxTSvec_[xx]>9) continue; // don't allow
157  auxflag+=(i->sample(AuxTSvec_[xx]).adc())<<(7*xx); // store the time slices in the first 28 bits of aux, a set of 4 7-bit a dc values
158  }
159  // bits 28 and 29 are reserved for capid of the first time slice saved in aux
160  if (!AuxTSvec_.empty())
161  auxflag+=((i->sample(AuxTSvec_[0]).capid())<<28);
162  (rec->back()).setAux(auxflag);
163  }
164  // return result
165  e.put(std::move(rec));
166  } // else if (det_==DetId::Calo...)
167 
168 } // void HcalHitReconstructor::produce(...)
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:137
std::vector< unsigned int > signalTS() const
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:579
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:47
std::vector< ZDCDataFrame >::const_iterator const_iterator
const Item * getValues(DetId fId, bool throwOnFail=true) const
edm::EDGetTokenT< ZDCDigiCollection > tok_input_hcal
ZDCRecHit reconstruct(const ZDCDataFrame &digi, const std::vector< unsigned int > &myNoiseTS, const std::vector< unsigned int > &mySignalTS, const HcalCoder &coder, const HcalCalibrations &calibs) const
ZdcSimpleRecAlgo reco_
HcalLongRecoParams * myobject
bool dropChannel(const uint32_t &mystatus) const
void setSaturationFlag(HBHERecHit &rechit, const HBHEDataFrame &digi)
HcalADCSaturationFlag * saturationFlagSetter_
bool isValid() const
Definition: HandleBase.h:74
edm::EDGetTokenT< ZDCDigiCollection > tok_input_castor
const_iterator end() const
Definition: DetId.h:18
static const int SubdetectorId
Definition: HcalZDCDetId.h:25
const HcalQIECoder * getHcalCoder(const HcalGenericDetId &fId) const
std::vector< int > AuxTSvec_
const HcalQIEShape * getHcalShape(const HcalGenericDetId &fId) const
size_type size() const
std::vector< unsigned int > noiseTS() const
uint32_t getValue() const
const HcalCalibrations & getHcalCalibrations(const HcalGenericDetId &fId) const
T const * product() const
Definition: ESHandle.h:86
def move(src, dest)
Definition: eostools.py:510
const_iterator begin() const

Member Data Documentation

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

Definition at line 64 of file ZdcHitReconstructor.h.

Referenced by produce(), and ZdcHitReconstructor().

bool ZdcHitReconstructor::correctTiming_
private

Definition at line 57 of file ZdcHitReconstructor.h.

DetId::Detector ZdcHitReconstructor::det_
private

Definition at line 51 of file ZdcHitReconstructor.h.

Referenced by produce(), and ZdcHitReconstructor().

bool ZdcHitReconstructor::dropZSmarkedPassed_
private

Definition at line 63 of file ZdcHitReconstructor.h.

Referenced by produce().

HBHETimeProfileStatusBitSetter* ZdcHitReconstructor::hbheHSCPFlagSetter_
private

Definition at line 46 of file ZdcHitReconstructor.h.

HBHETimingShapedFlagSetter* ZdcHitReconstructor::hbheTimingShapedFlagSetter_
private

Definition at line 47 of file ZdcHitReconstructor.h.

HcalHFStatusBitFromDigis* ZdcHitReconstructor::hfdigibit_
private

Definition at line 49 of file ZdcHitReconstructor.h.

HcalHFStatusBitFromRecHits* ZdcHitReconstructor::hfrechitbit_
private

Definition at line 48 of file ZdcHitReconstructor.h.

HFTimingTrustFlag* ZdcHitReconstructor::HFTimingTrustFlagSetter_
private

Definition at line 45 of file ZdcHitReconstructor.h.

double ZdcHitReconstructor::lowGainFrac_
private

Definition at line 67 of file ZdcHitReconstructor.h.

int ZdcHitReconstructor::lowGainOffset_
private

Definition at line 66 of file ZdcHitReconstructor.h.

HcalLongRecoParams* ZdcHitReconstructor::myobject
private

Definition at line 69 of file ZdcHitReconstructor.h.

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

ZdcSimpleRecAlgo ZdcHitReconstructor::reco_
private

Definition at line 43 of file ZdcHitReconstructor.h.

Referenced by produce().

HcalADCSaturationFlag* ZdcHitReconstructor::saturationFlagSetter_
private

Definition at line 44 of file ZdcHitReconstructor.h.

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

bool ZdcHitReconstructor::setHSCPFlags_
private

Definition at line 59 of file ZdcHitReconstructor.h.

bool ZdcHitReconstructor::setNoiseFlags_
private

Definition at line 58 of file ZdcHitReconstructor.h.

bool ZdcHitReconstructor::setSaturationFlags_
private

Definition at line 60 of file ZdcHitReconstructor.h.

Referenced by produce(), and ZdcHitReconstructor().

bool ZdcHitReconstructor::setTimingTrustFlags_
private

Definition at line 61 of file ZdcHitReconstructor.h.

int ZdcHitReconstructor::subdet_
private

Definition at line 52 of file ZdcHitReconstructor.h.

Referenced by produce(), and ZdcHitReconstructor().

HcalOtherSubdetector ZdcHitReconstructor::subdetOther_
private

Definition at line 53 of file ZdcHitReconstructor.h.

Referenced by ZdcHitReconstructor().

HcalTopology* ZdcHitReconstructor::theTopology
private

Definition at line 70 of file ZdcHitReconstructor.h.

Referenced by beginRun(), and endRun().

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

Definition at line 55 of file ZdcHitReconstructor.h.

Referenced by produce(), and ZdcHitReconstructor().

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

Definition at line 54 of file ZdcHitReconstructor.h.

Referenced by produce(), and ZdcHitReconstructor().