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
ZdcSimpleReconstructor Class Reference

#include <ZdcSimpleReconstructor.h>

Inheritance diagram for ZdcSimpleReconstructor:
edm::stream::EDProducer< T > edm::stream::EDProducerBase 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)
 
 ZdcSimpleReconstructor (const edm::ParameterSet &ps)
 
virtual ~ZdcSimpleReconstructor ()
 
- Public Member Functions inherited from edm::stream::EDProducer< T >
 EDProducer ()=default
 
- Public Member Functions inherited from edm::stream::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDProducerBase ()
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 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
std::vector< ConsumesInfoconsumesInfo () const
 
 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 (std::string const &iProcessName, std::string const &iModuleLabel, bool iPrint, std::vector< char const * > &oModuleLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Private Attributes

DetId::Detector det_
 
bool dropZSmarkedPassed_
 
HcalLongRecoParamsmyobject
 
ZdcSimpleRecAlgo reco_
 
int subdet_
 
HcalOtherSubdetector subdetOther_
 
edm::EDGetTokenT
< ZDCDigiCollection
tok_input_castor
 
edm::EDGetTokenT
< ZDCDigiCollection
tok_input_hcal
 

Additional Inherited Members

- Public Types inherited from edm::stream::EDProducer< T >
typedef CacheContexts< T...> CacheTypes
 
typedef CacheTypes::GlobalCache GlobalCache
 
typedef AbilityChecker< T...> HasAbility
 
typedef
CacheTypes::LuminosityBlockCache 
LuminosityBlockCache
 
typedef
LuminosityBlockContextT
< LuminosityBlockCache,
RunCache, GlobalCache
LuminosityBlockContext
 
typedef
CacheTypes::LuminosityBlockSummaryCache 
LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache,
GlobalCache
RunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 
- Public Types inherited from edm::stream::EDProducerBase
typedef EDProducerAdaptorBase ModuleType
 
- Public Types inherited from edm::ProducerBase
typedef
ProductRegistryHelper::TypeLabelList 
TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::stream::EDProducerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- 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

Definition at line 23 of file ZdcSimpleReconstructor.h.

Constructor & Destructor Documentation

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

Definition at line 14 of file ZdcSimpleReconstructor.cc.

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

14  :
15  reco_(conf.getParameter<bool>("correctForTimeslew"),
16  conf.getParameter<bool>("correctForPhaseContainment"),conf.getParameter<double>("correctionPhaseNS"),
17  conf.getParameter<int>("recoMethod"),
18  conf.getParameter<int>("lowGainOffset"),
19  conf.getParameter<double>("lowGainFrac")),
21  dropZSmarkedPassed_(conf.getParameter<bool>("dropZSmarkedPassed"))
22 {
23  tok_input_castor = consumes<ZDCDigiCollection>(conf.getParameter<edm::InputTag>("digiLabelcastor"));
24  tok_input_hcal = consumes<ZDCDigiCollection>(conf.getParameter<edm::InputTag>("digiLabelhcal"));
25 
26 
27  std::string subd=conf.getParameter<std::string>("Subdetector");
28  if (!strcasecmp(subd.c_str(),"ZDC")) {
31  produces<ZDCRecHitCollection>();
32  } else if (!strcasecmp(subd.c_str(),"CALIB")) {
35  produces<HcalCalibRecHitCollection>();
36  } else {
37  std::cout << "ZdcSimpleReconstructor is not associated with a specific subdetector!" << std::endl;
38  }
39 
40 }
HcalOtherSubdetector subdetOther_
edm::EDGetTokenT< ZDCDigiCollection > tok_input_hcal
edm::EDGetTokenT< ZDCDigiCollection > tok_input_castor
static const int SubdetectorId
Definition: HcalZDCDetId.h:25
tuple cout
Definition: gather_cfg.py:145
ZdcSimpleReconstructor::~ZdcSimpleReconstructor ( )
virtual

Definition at line 42 of file ZdcSimpleReconstructor.cc.

42  {
43 }

Member Function Documentation

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

Reimplemented from edm::stream::EDProducerBase.

Definition at line 51 of file ZdcSimpleReconstructor.cc.

References myobject.

51  {
52  delete myobject; myobject = 0;
53 }
HcalLongRecoParams * myobject
void ZdcSimpleReconstructor::produce ( edm::Event e,
const edm::EventSetup c 
)
virtual

Implements edm::stream::EDProducerBase.

Definition at line 54 of file ZdcSimpleReconstructor.cc.

References DetId::Calo, det_, dropZSmarkedPassed_, edm::EventSetup::get(), edm::Event::getByToken(), HcalCondObjectContainer< Item >::getValues(), i, ZdcSimpleRecAlgo::initPulseCorr(), myobject, HcalLongRecoParam::noiseTS(), edm::Event::put(), reco_, ZdcSimpleRecAlgo::reconstruct(), HcalLongRecoParam::signalTS(), subdet_, HcalZDCDetId::SubdetectorId, tok_input_castor, and tok_input_hcal.

55 {
56  // get conditions
58  eventSetup.get<HcalDbRecord>().get(conditions);
59  // define vectors to pass noiseTS and signalTS
60  std::vector<unsigned int> mySignalTS;
61  std::vector<unsigned int> myNoiseTS;
62 
65  e.getByToken(tok_input_hcal,digi);
66 
67  if(digi->size() == 0) {
69  if(digi->size() == 0)
70  edm::LogInfo("ZdcHitReconstructor") << "No ZDC info found in either castorDigis or hcalDigis." << std::endl;
71  }
72 
73  // create empty output
74  std::auto_ptr<ZDCRecHitCollection> rec(new ZDCRecHitCollection);
75  rec->reserve(digi->size());
76  // run the algorithm
77  unsigned int toaddMem = 0;
78 
80  for (i=digi->begin(); i!=digi->end(); i++) {
81  HcalZDCDetId cell = i->id();
82  DetId detcell=(DetId)cell;
83  // rof 27.03.09: drop ZS marked and passed digis:
85  if (i->zsMarkAndPass()) continue;
86 
87 // get db values for signalTSs and noiseTSs
88  const HcalLongRecoParam* myParams = myobject->getValues(detcell);
89  mySignalTS.clear();
90  myNoiseTS.clear();
91  mySignalTS = myParams->signalTS();
92  myNoiseTS = myParams->noiseTS();
93 // warning: the PulseCorrection is not used by ZDC. If it gets a non-contingious set of
94 // signal TS, it may not work properly. Assume contiguous here....
95  unsigned int toadd = mySignalTS.size();
96  if(toaddMem != toadd) {
97  reco_.initPulseCorr(toadd);
98  toaddMem = toadd;
99  }
100  const HcalCalibrations& calibrations=conditions->getHcalCalibrations(cell);
101  const HcalQIECoder* channelCoder = conditions->getHcalCoder (cell);
102  const HcalQIEShape* shape = conditions->getHcalShape (channelCoder);
103  HcalCoderDb coder (*channelCoder, *shape);
104  rec->push_back(reco_.reconstruct(*i,myNoiseTS,mySignalTS,coder,calibrations));
105  }
106  // return result
107  e.put(rec);
108  }
109 }
int i
Definition: DBlmapReader.cc:9
std::vector< unsigned int > signalTS() const
HcalLongRecoParams * myobject
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:462
edm::EDGetTokenT< ZDCDigiCollection > tok_input_hcal
std::vector< ZDCDataFrame >::const_iterator const_iterator
const Item * getValues(DetId fId, bool throwOnFail=true) const
ZDCRecHit reconstruct(const ZDCDataFrame &digi, const std::vector< unsigned int > &myNoiseTS, const std::vector< unsigned int > &mySignalTS, const HcalCoder &coder, const HcalCalibrations &calibs) const
void initPulseCorr(int toadd)
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:121
edm::EDGetTokenT< ZDCDigiCollection > tok_input_castor
Definition: DetId.h:18
static const int SubdetectorId
Definition: HcalZDCDetId.h:25
std::vector< unsigned int > noiseTS() const

Member Data Documentation

DetId::Detector ZdcSimpleReconstructor::det_
private

Definition at line 32 of file ZdcSimpleReconstructor.h.

Referenced by produce(), and ZdcSimpleReconstructor().

bool ZdcSimpleReconstructor::dropZSmarkedPassed_
private

Definition at line 38 of file ZdcSimpleReconstructor.h.

Referenced by produce().

HcalLongRecoParams* ZdcSimpleReconstructor::myobject
private

Definition at line 40 of file ZdcSimpleReconstructor.h.

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

ZdcSimpleRecAlgo ZdcSimpleReconstructor::reco_
private

Definition at line 31 of file ZdcSimpleReconstructor.h.

Referenced by produce().

int ZdcSimpleReconstructor::subdet_
private

Definition at line 33 of file ZdcSimpleReconstructor.h.

Referenced by produce(), and ZdcSimpleReconstructor().

HcalOtherSubdetector ZdcSimpleReconstructor::subdetOther_
private

Definition at line 34 of file ZdcSimpleReconstructor.h.

Referenced by ZdcSimpleReconstructor().

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

Definition at line 36 of file ZdcSimpleReconstructor.h.

Referenced by produce(), and ZdcSimpleReconstructor().

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

Definition at line 35 of file ZdcSimpleReconstructor.h.

Referenced by produce(), and ZdcSimpleReconstructor().