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::ProductRegistryHelper

Public Member Functions

virtual void beginRun (edm::Run &r, edm::EventSetup const &es)
 
virtual void endRun (edm::Run &r, edm::EventSetup const &es)
 
virtual void produce (edm::Event &e, const edm::EventSetup &c)
 
 ZdcHitReconstructor (const edm::ParameterSet &ps)
 
virtual ~ZdcHitReconstructor ()
 
- Public Member Functions inherited from edm::EDProducer
 EDProducer ()
 
virtual ~EDProducer ()
 
- Public Member Functions inherited from edm::ProducerBase
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
boost::function< void(const
BranchDescription &)> 
registrationCallback () const
 used by the fwk to register list of products More...
 
virtual ~ProducerBase ()
 

Private Attributes

std::vector< int > AuxTSvec_
 
bool correctTiming_
 
DetId::Detector det_
 
bool dropZSmarkedPassed_
 
HBHEStatusBitSetterhbheFlagSetter_
 
HBHETimeProfileStatusBitSetterhbheHSCPFlagSetter_
 
HBHETimingShapedFlagSetterhbheTimingShapedFlagSetter_
 
HcalHFStatusBitFromDigishfdigibit_
 
HcalHFStatusBitFromRecHitshfrechitbit_
 
HFTimingTrustFlagHFTimingTrustFlagSetter_
 
edm::InputTag inputLabel_
 
double lowGainFrac_
 
int lowGainOffset_
 
HcalLongRecoParamsmyobject
 
ZdcSimpleRecAlgo reco_
 
HcalADCSaturationFlagsaturationFlagSetter_
 
bool setHSCPFlags_
 
bool setNoiseFlags_
 
bool setSaturationFlags_
 
bool setTimingTrustFlags_
 
int subdet_
 
HcalOtherSubdetector subdetOther_
 

Additional Inherited Members

- Public Types inherited from edm::EDProducer
typedef EDProducer ModuleType
 
typedef WorkerT< EDProducerWorkerType
 
- 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::EDProducer
CurrentProcessingContext const * currentContext () const
 
- Protected Member Functions inherited from edm::ProducerBase
template<class TProducer , class TMethod >
void callWhenNewProductsRegistered (TProducer *iProd, TMethod iMethod)
 

Detailed Description

Date:
2011/11/10 10:16:20
Revision:
1.5
Author
E. Garcia - CSU Based on HcalSimpleReconstructor.h by J. Mans

Definition at line 33 of file ZdcHitReconstructor.h.

Constructor & Destructor Documentation

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

Definition at line 20 of file ZdcHitReconstructor.cc.

References AuxTSvec_, DetId::Calo, gather_cfg::cout, det_, edm::ParameterSet::getParameter(), HcalCalibration, HcalOther, saturationFlagSetter_, setSaturationFlags_, python.multivaluedict::sort(), subdet_, HcalZDCDetId::SubdetectorId, and subdetOther_.

20  :
21  reco_(conf.getParameter<bool>("correctForTimeslew"),
22  conf.getParameter<bool>("correctForPhaseContainment"),
23  conf.getParameter<double>("correctionPhaseNS"),
24  conf.getParameter<int>("recoMethod"),
25  conf.getParameter<int>("lowGainOffset"),
26  conf.getParameter<double>("lowGainFrac")),
28  inputLabel_(conf.getParameter<edm::InputTag>("digiLabel")),
29  correctTiming_(conf.getParameter<bool>("correctTiming")),
30  setNoiseFlags_(conf.getParameter<bool>("setNoiseFlags")),
31  setHSCPFlags_(conf.getParameter<bool>("setHSCPFlags")),
32  setSaturationFlags_(conf.getParameter<bool>("setSaturationFlags")),
33  setTimingTrustFlags_(conf.getParameter<bool>("setTimingTrustFlags")),
34  dropZSmarkedPassed_(conf.getParameter<bool>("dropZSmarkedPassed")),
35  AuxTSvec_(conf.getParameter<std::vector<int> >("AuxTSvec"))
36 
37 {
38  std::sort(AuxTSvec_.begin(),AuxTSvec_.end()); // sort vector in ascending TS order
39  std::string subd=conf.getParameter<std::string>("Subdetector");
40 
42  {
43  const edm::ParameterSet& pssat = conf.getParameter<edm::ParameterSet>("saturationParameters");
44  saturationFlagSetter_ = new HcalADCSaturationFlag(pssat.getParameter<int>("maxADCvalue"));
45  }
46  if (!strcasecmp(subd.c_str(),"ZDC")) {
49  produces<ZDCRecHitCollection>();
50  } else if (!strcasecmp(subd.c_str(),"CALIB")) {
53  produces<HcalCalibRecHitCollection>();
54  } else {
55  std::cout << "ZdcHitReconstructor is not associated with a specific subdetector!" << std::endl;
56  }
57 
58 }
T getParameter(std::string const &) const
ZdcSimpleRecAlgo reco_
HcalOtherSubdetector subdetOther_
HcalADCSaturationFlag * saturationFlagSetter_
tuple conf
Definition: dbtoconf.py:185
static const int SubdetectorId
Definition: HcalZDCDetId.h:22
std::vector< int > AuxTSvec_
tuple cout
Definition: gather_cfg.py:121
ZdcHitReconstructor::~ZdcHitReconstructor ( )
virtual

Definition at line 60 of file ZdcHitReconstructor.cc.

60  {;
61 }

Member Function Documentation

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

Reimplemented from edm::EDProducer.

Definition at line 69 of file ZdcHitReconstructor.cc.

References myobject.

69  {
70  if (myobject) delete myobject;
71 }
HcalLongRecoParams * myobject
void ZdcHitReconstructor::produce ( edm::Event e,
const edm::EventSetup c 
)
virtual

Implements edm::EDProducer.

Definition at line 72 of file ZdcHitReconstructor.cc.

References AuxTSvec_, DetId::Calo, det_, HcalSeverityLevelComputer::dropChannel(), dropZSmarkedPassed_, edm::EventSetup::get(), edm::Event::getByLabel(), HcalChannelStatus::getValue(), HcalCondObjectContainer< Item >::getValues(), i, inputLabel_, 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_, and HcalZDCDetId::SubdetectorId.

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

Member Data Documentation

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

Definition at line 62 of file ZdcHitReconstructor.h.

Referenced by produce(), and ZdcHitReconstructor().

bool ZdcHitReconstructor::correctTiming_
private

Definition at line 55 of file ZdcHitReconstructor.h.

DetId::Detector ZdcHitReconstructor::det_
private

Definition at line 50 of file ZdcHitReconstructor.h.

Referenced by produce(), and ZdcHitReconstructor().

bool ZdcHitReconstructor::dropZSmarkedPassed_
private

Definition at line 61 of file ZdcHitReconstructor.h.

Referenced by produce().

HBHEStatusBitSetter* ZdcHitReconstructor::hbheFlagSetter_
private

Definition at line 44 of file ZdcHitReconstructor.h.

HBHETimeProfileStatusBitSetter* ZdcHitReconstructor::hbheHSCPFlagSetter_
private

Definition at line 45 of file ZdcHitReconstructor.h.

HBHETimingShapedFlagSetter* ZdcHitReconstructor::hbheTimingShapedFlagSetter_
private

Definition at line 46 of file ZdcHitReconstructor.h.

HcalHFStatusBitFromDigis* ZdcHitReconstructor::hfdigibit_
private

Definition at line 48 of file ZdcHitReconstructor.h.

HcalHFStatusBitFromRecHits* ZdcHitReconstructor::hfrechitbit_
private

Definition at line 47 of file ZdcHitReconstructor.h.

HFTimingTrustFlag* ZdcHitReconstructor::HFTimingTrustFlagSetter_
private

Definition at line 43 of file ZdcHitReconstructor.h.

edm::InputTag ZdcHitReconstructor::inputLabel_
private

Definition at line 53 of file ZdcHitReconstructor.h.

Referenced by produce().

double ZdcHitReconstructor::lowGainFrac_
private

Definition at line 65 of file ZdcHitReconstructor.h.

int ZdcHitReconstructor::lowGainOffset_
private

Definition at line 64 of file ZdcHitReconstructor.h.

HcalLongRecoParams* ZdcHitReconstructor::myobject
private

Definition at line 67 of file ZdcHitReconstructor.h.

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

ZdcSimpleRecAlgo ZdcHitReconstructor::reco_
private

Definition at line 41 of file ZdcHitReconstructor.h.

Referenced by produce().

HcalADCSaturationFlag* ZdcHitReconstructor::saturationFlagSetter_
private

Definition at line 42 of file ZdcHitReconstructor.h.

Referenced by produce(), and ZdcHitReconstructor().

bool ZdcHitReconstructor::setHSCPFlags_
private

Definition at line 57 of file ZdcHitReconstructor.h.

bool ZdcHitReconstructor::setNoiseFlags_
private

Definition at line 56 of file ZdcHitReconstructor.h.

bool ZdcHitReconstructor::setSaturationFlags_
private

Definition at line 58 of file ZdcHitReconstructor.h.

Referenced by produce(), and ZdcHitReconstructor().

bool ZdcHitReconstructor::setTimingTrustFlags_
private

Definition at line 59 of file ZdcHitReconstructor.h.

int ZdcHitReconstructor::subdet_
private

Definition at line 51 of file ZdcHitReconstructor.h.

Referenced by produce(), and ZdcHitReconstructor().

HcalOtherSubdetector ZdcHitReconstructor::subdetOther_
private

Definition at line 52 of file ZdcHitReconstructor.h.

Referenced by ZdcHitReconstructor().