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

#include <HcalRealisticZS.h>

Inheritance diagram for HcalRealisticZS:
edm::stream::EDProducer<> edm::stream::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 HcalRealisticZS (const edm::ParameterSet &ps)
 
virtual void produce (edm::Event &e, const edm::EventSetup &c) override
 
virtual ~HcalRealisticZS ()
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 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

std::unique_ptr
< HcalZSAlgoRealistic
algo_
 
std::string inputLabel_
 
edm::EDGetTokenT
< HBHEDigiCollection
tok_hbhe_
 
edm::EDGetTokenT
< HBHEUpgradeDigiCollection
tok_hbheUpgrade_
 
edm::EDGetTokenT
< HFDigiCollection
tok_hf_
 
edm::EDGetTokenT
< QIE10DigiCollection
tok_hfQIE10_
 
edm::EDGetTokenT
< HFUpgradeDigiCollection
tok_hfUpgrade_
 
edm::EDGetTokenT
< HODigiCollection
tok_ho_
 

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, 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 20 of file HcalRealisticZS.h.

Constructor & Destructor Documentation

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

Definition at line 12 of file HcalRealisticZS.cc.

References algo_, edm::ParameterSet::getParameter(), inputLabel_, HLT_FULL_cff::InputTag, tmp, tok_hbhe_, tok_hbheUpgrade_, tok_hf_, tok_hfQIE10_, tok_hfUpgrade_, and tok_ho_.

12  :
13  inputLabel_(conf.getParameter<std::string>("digiLabel")) {
14 
15  bool markAndPass=conf.getParameter<bool>("markAndPass");
16 
17  // register for data access
18  tok_hbhe_ = consumes<HBHEDigiCollection>(edm::InputTag(inputLabel_));
19  tok_ho_ = consumes<HODigiCollection>(edm::InputTag(inputLabel_));
20  tok_hf_ = consumes<HFDigiCollection>(edm::InputTag(inputLabel_));
21  tok_hbheUpgrade_ = consumes<HBHEUpgradeDigiCollection>(edm::InputTag(inputLabel_, "HBHEUpgradeDigiCollection"));
22  tok_hfUpgrade_ = consumes<HFUpgradeDigiCollection>(edm::InputTag(inputLabel_, "HFUpgradeDigiCollection"));
23  tok_hfQIE10_ = consumes<QIE10DigiCollection>(edm::InputTag(inputLabel_, "HFQIE10DigiCollection"));
24 
25 
26  std::vector<int> tmp = conf.getParameter<std::vector<int> >("HBregion");
27 
28  if(tmp[0]<0 || tmp[0]>9 || tmp[1]<0 || tmp[1]>9 || tmp[0]>tmp[1]) {
29  edm::LogError("HcalZeroSuppression") << "ZS(HB) region error: "
30  << tmp[0] << ":" <<tmp[1];
31  tmp[0]=0; tmp[1]=9;
32  }
33 
34  std::pair<int,int> HBsearchTS (tmp[0],tmp[1]);
35 
36  tmp = conf.getParameter<std::vector<int> >("HEregion");
37  if(tmp[0]<0 || tmp[0]>9 || tmp[1]<0 || tmp[1]>9 || tmp[0]>tmp[1]) {
38  edm::LogError("HcalZeroSuppression") << "ZS(HE) region error: "
39  << tmp[0] << ":" <<tmp[1];
40  tmp[0]=0; tmp[1]=9;
41  }
42  std::pair<int,int> HEsearchTS (tmp[0],tmp[1]);
43 
44  tmp = conf.getParameter<std::vector<int> >("HOregion");
45  if(tmp[0]<0 || tmp[0]>9 || tmp[1]<0 || tmp[1]>9 || tmp[0]>tmp[1]) {
46  edm::LogError("HcalZeroSuppression") << "ZS(HO) region error: "
47  << tmp[0] << ":" <<tmp[1];
48  tmp[0]=0; tmp[1]=9;
49  }
50  std::pair<int,int> HOsearchTS (tmp[0],tmp[1]);
51 
52  tmp = conf.getParameter<std::vector<int> >("HFregion");
53  if(tmp[0]<0 || tmp[0]>9 || tmp[1]<0 || tmp[1]>9 || tmp[0]>tmp[1]) {
54  edm::LogError("HcalZeroSuppression") << "ZS(HF) region error: "
55  << tmp[0] << ":" <<tmp[1];
56  tmp[0]=0; tmp[1]=9;
57  }
58  std::pair<int,int> HFsearchTS (tmp[0],tmp[1]);
59 
60 
61  //this constructor will be called if useConfigZSvalues is set to 1 in
62  //HcalZeroSuppressionProducers/python/hcalDigisRealistic_cfi.py
63  //which means that channel-by-channel ZS thresholds from DB will NOT be used
64  if ( conf.getParameter<int>("useConfigZSvalues") ) {
65 
66  algo_.reset(
67  new HcalZSAlgoRealistic (markAndPass,
68  conf.getParameter<int>("HBlevel"),
69  conf.getParameter<int>("HElevel"),
70  conf.getParameter<int>("HOlevel"),
71  conf.getParameter<int>("HFlevel"),
72  HBsearchTS,
73  HEsearchTS,
74  HOsearchTS,
75  HFsearchTS
76  ));
77 
78  } else {
79 
80  algo_.reset(
81  new HcalZSAlgoRealistic(markAndPass,
82  HBsearchTS,
83  HEsearchTS,
84  HOsearchTS,
85  HFsearchTS));
86  }
87 
88  produces<HBHEDigiCollection>();
89  produces<HODigiCollection>();
90  produces<HFDigiCollection>();
91  produces<HBHEUpgradeDigiCollection>("HBHEUpgradeDigiCollection");
92  produces<HFUpgradeDigiCollection>("HFUpgradeDigiCollection");
93  produces<QIE10DigiCollection>("HFQIE10DigiCollection");
94 
95 }
edm::EDGetTokenT< HODigiCollection > tok_ho_
std::unique_ptr< HcalZSAlgoRealistic > algo_
edm::EDGetTokenT< QIE10DigiCollection > tok_hfQIE10_
edm::EDGetTokenT< HBHEDigiCollection > tok_hbhe_
edm::EDGetTokenT< HFUpgradeDigiCollection > tok_hfUpgrade_
edm::EDGetTokenT< HBHEUpgradeDigiCollection > tok_hbheUpgrade_
std::string inputLabel_
edm::EDGetTokenT< HFDigiCollection > tok_hf_
std::vector< std::vector< double > > tmp
Definition: MVATrainer.cc:100
HcalRealisticZS::~HcalRealisticZS ( )
virtual

Definition at line 97 of file HcalRealisticZS.cc.

References algo_.

97  {
98  algo_->clearDbService();
99 }
std::unique_ptr< HcalZSAlgoRealistic > algo_

Member Function Documentation

void HcalRealisticZS::produce ( edm::Event e,
const edm::EventSetup c 
)
overridevirtual

Implements edm::stream::EDProducerBase.

Definition at line 101 of file HcalRealisticZS.cc.

References algo_, edm::EventSetup::get(), edm::Event::getByToken(), edm::Handle< T >::product(), edm::ESHandle< class >::product(), edm::Event::put(), tok_hbhe_, tok_hbheUpgrade_, tok_hf_, tok_hfQIE10_, tok_hfUpgrade_, and tok_ho_.

102 {
103 
110 
111  edm::ESHandle<HcalDbService> conditions;
112  eventSetup.get<HcalDbRecord>().get(conditions);
113  algo_->setDbService(conditions.product());
114 
115  e.getByToken(tok_hbhe_,hbhe);
116 
117  // create empty output
118  std::auto_ptr<HBHEDigiCollection> zs_hbhe(new HBHEDigiCollection);
119 
120  e.getByToken(tok_ho_,ho);
121 
122  // create empty output
123  std::auto_ptr<HODigiCollection> zs_ho(new HODigiCollection);
124 
125  e.getByToken(tok_hf_,hf);
126 
127  // create empty output
128  std::auto_ptr<HFDigiCollection> zs_hf(new HFDigiCollection);
129 
130  e.getByToken(tok_hbheUpgrade_,hbheUpgrade);
131  e.getByToken(tok_hfUpgrade_,hfUpgrade);
132  e.getByToken(tok_hfQIE10_,hfQIE10);
133 
134  // create empty output
135  std::auto_ptr<HBHEUpgradeDigiCollection> zs_hbheUpgrade(new HBHEUpgradeDigiCollection);
136  std::auto_ptr<HFUpgradeDigiCollection> zs_hfUpgrade(new HFUpgradeDigiCollection);
137  std::auto_ptr<QIE10DigiCollection> zs_hfQIE10(new QIE10DigiCollection);
138 
139  //run the algorithm
140 
141  algo_->suppress(*(hbhe.product()),*zs_hbhe);
142  algo_->suppress(*(ho.product()),*zs_ho);
143  algo_->suppress(*(hf.product()),*zs_hf);
144  algo_->suppress(*(hbheUpgrade.product()),*zs_hbheUpgrade);
145  algo_->suppress(*(hfUpgrade.product()),*zs_hfUpgrade);
146  algo_->suppress(*(hfQIE10.product()),*zs_hfQIE10);
147 
148 
149  edm::LogInfo("HcalZeroSuppression") << "Suppression (HBHE) input " << hbhe->size() << " digis, output " << zs_hbhe->size() << " digis"
150  << " (HO) input " << ho->size() << " digis, output " << zs_ho->size() << " digis"
151  << " (HF) input " << hf->size() << " digis, output " << zs_hf->size() << " digis"
152  << " (HBHEUpgrade) input " << hbheUpgrade->size() << " digis, output " << zs_hbheUpgrade->size() << " digis"
153  << " (HFUpgrade) input " << hfUpgrade->size() << " digis, output " << zs_hfUpgrade->size() << " digis"
154  << " (HFQIE10) input " << hfQIE10->size() << " digis, output " << zs_hfQIE10->size() << " digis";
155 
156 
157  // return result
158  e.put(zs_hbhe);
159  e.put(zs_ho);
160  e.put(zs_hf);
161  e.put(zs_hbheUpgrade,"HBHEUpgradeDigiCollection");
162  e.put(zs_hfUpgrade,"HFUpgradeDigiCollection");
163  e.put(zs_hfQIE10,"HFQIE10DigiCollection");
164 
165 }
edm::EDGetTokenT< HODigiCollection > tok_ho_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:462
std::unique_ptr< HcalZSAlgoRealistic > algo_
edm::EDGetTokenT< QIE10DigiCollection > tok_hfQIE10_
edm::EDGetTokenT< HBHEDigiCollection > tok_hbhe_
edm::EDGetTokenT< HFUpgradeDigiCollection > tok_hfUpgrade_
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:121
edm::EDGetTokenT< HBHEUpgradeDigiCollection > tok_hbheUpgrade_
edm::EDGetTokenT< HFDigiCollection > tok_hf_
T const * product() const
Definition: Handle.h:81
T const * product() const
Definition: ESHandle.h:86

Member Data Documentation

std::unique_ptr<HcalZSAlgoRealistic> HcalRealisticZS::algo_
private

Definition at line 26 of file HcalRealisticZS.h.

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

std::string HcalRealisticZS::inputLabel_
private

Definition at line 27 of file HcalRealisticZS.h.

Referenced by HcalRealisticZS().

edm::EDGetTokenT<HBHEDigiCollection> HcalRealisticZS::tok_hbhe_
private

Definition at line 28 of file HcalRealisticZS.h.

Referenced by HcalRealisticZS(), and produce().

edm::EDGetTokenT<HBHEUpgradeDigiCollection> HcalRealisticZS::tok_hbheUpgrade_
private

Definition at line 31 of file HcalRealisticZS.h.

Referenced by HcalRealisticZS(), and produce().

edm::EDGetTokenT<HFDigiCollection> HcalRealisticZS::tok_hf_
private

Definition at line 30 of file HcalRealisticZS.h.

Referenced by HcalRealisticZS(), and produce().

edm::EDGetTokenT<QIE10DigiCollection> HcalRealisticZS::tok_hfQIE10_
private

Definition at line 33 of file HcalRealisticZS.h.

Referenced by HcalRealisticZS(), and produce().

edm::EDGetTokenT<HFUpgradeDigiCollection> HcalRealisticZS::tok_hfUpgrade_
private

Definition at line 32 of file HcalRealisticZS.h.

Referenced by HcalRealisticZS(), and produce().

edm::EDGetTokenT<HODigiCollection> HcalRealisticZS::tok_ho_
private

Definition at line 29 of file HcalRealisticZS.h.

Referenced by HcalRealisticZS(), and produce().