CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes
ZdcHitReconstructor Class Reference

#include <ZdcHitReconstructor.h>

Inheritance diagram for ZdcHitReconstructor:
edm::EDProducer edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

virtual void beginRun (edm::Run const &r, edm::EventSetup const &es) overridefinal
 
virtual void endRun (edm::Run const &r, edm::EventSetup const &es) overridefinal
 
virtual void produce (edm::Event &e, const edm::EventSetup &c) overridefinal
 
 ZdcHitReconstructor (const edm::ParameterSet &ps)
 
virtual ~ZdcHitReconstructor ()
 
- Public Member Functions inherited from edm::EDProducer
 EDProducer ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDProducer ()
 
- Public Member Functions inherited from edm::ProducerBase
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription
const &)> 
registrationCallback () const
 used by the fwk to register list of products More...
 
virtual ~ProducerBase ()
 
- Public Member Functions inherited from edm::EDConsumerBase
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesDependentUpon (const std::string &iProcessName, std::vector< const char * > &oModuleLabels) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Private Attributes

std::vector< int > AuxTSvec_
 
bool correctTiming_
 
DetId::Detector det_
 
bool dropZSmarkedPassed_
 
HBHEStatusBitSetterhbheFlagSetter_
 
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
< ZDCDigiCollection
tok_input_
 

Additional Inherited Members

- Public Types inherited from edm::EDProducer
typedef EDProducer ModuleType
 
- Public Types inherited from edm::ProducerBase
typedef
ProductRegistryHelper::TypeLabelList 
TypeLabelList
 
- Static Public Member Functions inherited from edm::EDProducer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

Detailed Description

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

Definition at line 36 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_, python.multivaluedict::sort(), AlCaHLTBitMon_QueryRunRegistry::string, subdet_, HcalZDCDetId::SubdetectorId, subdetOther_, and tok_input_.

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")),
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  myobject(0),
34  theTopology(0)
35 
36 {
37  tok_input_ = consumes<ZDCDigiCollection>(conf.getParameter<edm::InputTag>("digiLabel"));
38 
39  std::sort(AuxTSvec_.begin(),AuxTSvec_.end()); // sort vector in ascending TS order
40  std::string subd=conf.getParameter<std::string>("Subdetector");
41 
43  {
44  const edm::ParameterSet& pssat = conf.getParameter<edm::ParameterSet>("saturationParameters");
45  saturationFlagSetter_ = new HcalADCSaturationFlag(pssat.getParameter<int>("maxADCvalue"));
46  }
47  if (!strcasecmp(subd.c_str(),"ZDC")) {
50  produces<ZDCRecHitCollection>();
51  } else if (!strcasecmp(subd.c_str(),"CALIB")) {
54  produces<HcalCalibRecHitCollection>();
55  } else {
56  std::cout << "ZdcHitReconstructor is not associated with a specific subdetector!" << std::endl;
57  }
58 
59 }
T getParameter(std::string const &) const
HcalTopology * theTopology
ZdcSimpleRecAlgo reco_
HcalOtherSubdetector subdetOther_
HcalLongRecoParams * myobject
HcalADCSaturationFlag * saturationFlagSetter_
tuple conf
Definition: dbtoconf.py:185
static const int SubdetectorId
Definition: HcalZDCDetId.h:20
std::vector< int > AuxTSvec_
edm::EDGetTokenT< ZDCDigiCollection > tok_input_
tuple cout
Definition: gather_cfg.py:121
ZdcHitReconstructor::~ZdcHitReconstructor ( )
virtual

Definition at line 61 of file ZdcHitReconstructor.cc.

61  {;
62 }

Member Function Documentation

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

Reimplemented from edm::EDProducer.

Definition at line 76 of file ZdcHitReconstructor.cc.

References myobject, and theTopology.

76  {
77  delete myobject; myobject=0;
78  delete theTopology; theTopology=0;
79 }
HcalTopology * theTopology
HcalLongRecoParams * myobject
void ZdcHitReconstructor::produce ( edm::Event e,
const edm::EventSetup c 
)
finaloverridevirtual

Implements edm::EDProducer.

Definition at line 80 of file ZdcHitReconstructor.cc.

References AuxTSvec_, DetId::Calo, det_, HcalSeverityLevelComputer::dropChannel(), dropZSmarkedPassed_, edm::EventSetup::get(), edm::Event::getByToken(), HcalChannelStatus::getValue(), HcalCondObjectContainer< Item >::getValues(), i, myobject, HcalLongRecoParam::noiseTS(), AlCaHLTBitMon_ParallelJobs::p, edm::ESHandle< class >::product(), edm::Event::put(), DetId::rawId(), reco_, ZdcSimpleRecAlgo::reconstruct(), saturationFlagSetter_, HcalADCSaturationFlag::setSaturationFlag(), setSaturationFlags_, HcalLongRecoParam::signalTS(), subdet_, HcalZDCDetId::SubdetectorId, and tok_input_.

81 {
82  // get conditions
84  eventSetup.get<HcalDbRecord>().get(conditions);
85 
87  eventSetup.get<HcalChannelQualityRcd>().get(p);
88  HcalChannelQuality* myqual = new HcalChannelQuality(*p.product());
89 
91  eventSetup.get<HcalSeverityLevelComputerRcd>().get(mycomputer);
92  const HcalSeverityLevelComputer* mySeverity = mycomputer.product();
93 
94  // define vectors to pass noiseTS and signalTS
95  std::vector<unsigned int> mySignalTS;
96  std::vector<unsigned int> myNoiseTS;
97 
100  e.getByToken(tok_input_,digi);
101 
102  // create empty output
103  std::auto_ptr<ZDCRecHitCollection> rec(new ZDCRecHitCollection);
104  rec->reserve(digi->size());
105  // run the algorithm
107  for (i=digi->begin(); i!=digi->end(); i++) {
108  HcalZDCDetId cell = i->id();
109  DetId detcell=(DetId)cell;
110  // check on cells to be ignored and dropped: (rof,20.Feb.09)
111  const HcalChannelStatus* mydigistatus=myqual->getValues(detcell.rawId());
112  if (mySeverity->dropChannel(mydigistatus->getValue() ) ) continue;
114  if (i->zsMarkAndPass()) continue;
115  const HcalCalibrations& calibrations=conditions->getHcalCalibrations(cell);
116  const HcalQIECoder* channelCoder = conditions->getHcalCoder (cell);
117  const HcalQIEShape* shape = conditions->getHcalShape (channelCoder);
118  HcalCoderDb coder (*channelCoder, *shape);
119 
120 // get db values for signalTSs and noiseTSs
121  const HcalLongRecoParam* myParams = myobject->getValues(detcell);
122  mySignalTS.clear();
123  myNoiseTS.clear();
124  mySignalTS = myParams->signalTS();
125  myNoiseTS = myParams->noiseTS();
126 
127  rec->push_back(reco_.reconstruct(*i,myNoiseTS,mySignalTS,coder,calibrations));
128  (rec->back()).setFlags(0);
130  saturationFlagSetter_->setSaturationFlag(rec->back(),*i);
131 
132  // Set auxiliary flag with subset of digi information
133  // ZDC aux flag can store non-contiguous set of values
134  int auxflag=0;
135  for (unsigned int xx=0; xx<AuxTSvec_.size() && xx<4;++xx)
136  {
137  if (AuxTSvec_[xx]<0 || AuxTSvec_[xx]>9) continue; // don't allow
138  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
139  }
140  // bits 28 and 29 are reserved for capid of the first time slice saved in aux
141  if (AuxTSvec_.size()>0)
142  auxflag+=((i->sample(AuxTSvec_[0]).capid())<<28);
143  (rec->back()).setAux(auxflag);
144  }
145  // return result
146  e.put(rec);
147  } // else if (det_==DetId::Calo...)
148 
149  delete myqual;
150 } // void HcalHitReconstructor::produce(...)
int i
Definition: DBlmapReader.cc:9
std::vector< unsigned int > signalTS() const
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:434
std::vector< ZDCDataFrame >::const_iterator const_iterator
const Item * getValues(DetId fId, bool throwOnFail=true) const
uint32_t rawId() const
get the raw id
Definition: DetId.h:43
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_
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:116
HcalLongRecoParams * myobject
bool dropChannel(const uint32_t &mystatus) const
void setSaturationFlag(HBHERecHit &rechit, const HBHEDataFrame &digi)
HcalADCSaturationFlag * saturationFlagSetter_
Definition: DetId.h:18
static const int SubdetectorId
Definition: HcalZDCDetId.h:20
T const * product() const
Definition: ESHandle.h:62
std::vector< int > AuxTSvec_
edm::EDGetTokenT< ZDCDigiCollection > tok_input_
std::vector< unsigned int > noiseTS() const
uint32_t getValue() const

Member Data Documentation

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

Definition at line 65 of file ZdcHitReconstructor.h.

Referenced by produce(), and ZdcHitReconstructor().

bool ZdcHitReconstructor::correctTiming_
private

Definition at line 58 of file ZdcHitReconstructor.h.

DetId::Detector ZdcHitReconstructor::det_
private

Definition at line 53 of file ZdcHitReconstructor.h.

Referenced by produce(), and ZdcHitReconstructor().

bool ZdcHitReconstructor::dropZSmarkedPassed_
private

Definition at line 64 of file ZdcHitReconstructor.h.

Referenced by produce().

HBHEStatusBitSetter* ZdcHitReconstructor::hbheFlagSetter_
private

Definition at line 47 of file ZdcHitReconstructor.h.

HBHETimeProfileStatusBitSetter* ZdcHitReconstructor::hbheHSCPFlagSetter_
private

Definition at line 48 of file ZdcHitReconstructor.h.

HBHETimingShapedFlagSetter* ZdcHitReconstructor::hbheTimingShapedFlagSetter_
private

Definition at line 49 of file ZdcHitReconstructor.h.

HcalHFStatusBitFromDigis* ZdcHitReconstructor::hfdigibit_
private

Definition at line 51 of file ZdcHitReconstructor.h.

HcalHFStatusBitFromRecHits* ZdcHitReconstructor::hfrechitbit_
private

Definition at line 50 of file ZdcHitReconstructor.h.

HFTimingTrustFlag* ZdcHitReconstructor::HFTimingTrustFlagSetter_
private

Definition at line 46 of file ZdcHitReconstructor.h.

double ZdcHitReconstructor::lowGainFrac_
private

Definition at line 68 of file ZdcHitReconstructor.h.

int ZdcHitReconstructor::lowGainOffset_
private

Definition at line 67 of file ZdcHitReconstructor.h.

HcalLongRecoParams* ZdcHitReconstructor::myobject
private

Definition at line 70 of file ZdcHitReconstructor.h.

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

ZdcSimpleRecAlgo ZdcHitReconstructor::reco_
private

Definition at line 44 of file ZdcHitReconstructor.h.

Referenced by produce().

HcalADCSaturationFlag* ZdcHitReconstructor::saturationFlagSetter_
private

Definition at line 45 of file ZdcHitReconstructor.h.

Referenced by produce(), and ZdcHitReconstructor().

bool ZdcHitReconstructor::setHSCPFlags_
private

Definition at line 60 of file ZdcHitReconstructor.h.

bool ZdcHitReconstructor::setNoiseFlags_
private

Definition at line 59 of file ZdcHitReconstructor.h.

bool ZdcHitReconstructor::setSaturationFlags_
private

Definition at line 61 of file ZdcHitReconstructor.h.

Referenced by produce(), and ZdcHitReconstructor().

bool ZdcHitReconstructor::setTimingTrustFlags_
private

Definition at line 62 of file ZdcHitReconstructor.h.

int ZdcHitReconstructor::subdet_
private

Definition at line 54 of file ZdcHitReconstructor.h.

Referenced by produce(), and ZdcHitReconstructor().

HcalOtherSubdetector ZdcHitReconstructor::subdetOther_
private

Definition at line 55 of file ZdcHitReconstructor.h.

Referenced by ZdcHitReconstructor().

HcalTopology* ZdcHitReconstructor::theTopology
private

Definition at line 71 of file ZdcHitReconstructor.h.

Referenced by beginRun(), and endRun().

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

Definition at line 56 of file ZdcHitReconstructor.h.

Referenced by produce(), and ZdcHitReconstructor().