CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Private Attributes
HGCalLayerClusterProducer Class Reference
Inheritance diagram for HGCalLayerClusterProducer:
edm::stream::EDProducer<>

Public Member Functions

 HGCalLayerClusterProducer (const edm::ParameterSet &)
 
void produce (edm::Event &, const edm::EventSetup &) override
 
 ~HGCalLayerClusterProducer () override
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
bool hasAbilityToProduceInLumis () const final
 
bool hasAbilityToProduceInRuns () const final
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 

Private Attributes

std::unique_ptr< HGCalImagingAlgoalgo
 
reco::CaloCluster::AlgoId algoId
 
std::string detector
 
bool doSharing
 
edm::EDGetTokenT< HGCRecHitCollectionhits_bh_token
 
edm::EDGetTokenT< HGCRecHitCollectionhits_ee_token
 
edm::EDGetTokenT< HGCRecHitCollectionhits_fh_token
 
HGCalImagingAlgo::VerbosityLevel verbosity
 

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

Definition at line 30 of file HGCalLayerClusterProducer.cc.

Constructor & Destructor Documentation

HGCalLayerClusterProducer::HGCalLayerClusterProducer ( const edm::ParameterSet ps)

Definition at line 55 of file HGCalLayerClusterProducer.cc.

References algo, algoId, hgcalLayerClusters_cff::dEdXweights, detector, doSharing, hgcalLayerClusters_cff::fcPerEle, hgcalLayerClusters_cff::fcPerMip, edm::ParameterSet::getParameter(), reco::CaloCluster::hgcal_em, reco::CaloCluster::hgcal_had, reco::CaloCluster::hgcal_mixed, hits_bh_token, hits_ee_token, hits_fh_token, kappa, hgcalLayerClusters_cff::noiseMip, hgcalDigitizer_cfi::nonAgedNoises, particleFlowClusterECALUncorrected_cfi::showerSigma, hgcalLayerClusters_cff::thicknessCorrection, and verbosity.

55  :
57  doSharing(ps.getParameter<bool>("doSharing")),
58  detector(ps.getParameter<std::string >("detector")), // one of EE, FH, BH or "all"
59  verbosity((HGCalImagingAlgo::VerbosityLevel)ps.getUntrackedParameter<unsigned int>("verbosity",3)){
60  double ecut = ps.getParameter<double>("ecut");
61  std::vector<double> vecDeltas = ps.getParameter<std::vector<double> >("deltac");
62  double kappa = ps.getParameter<double>("kappa");
63  std::vector<double> dEdXweights = ps.getParameter<std::vector<double> >("dEdXweights");
64  std::vector<double> thicknessCorrection = ps.getParameter<std::vector<double> >("thicknessCorrection");
65  std::vector<double> fcPerMip = ps.getParameter<std::vector<double> >("fcPerMip");
66  double fcPerEle = ps.getParameter<double>("fcPerEle");
67  std::vector<double> nonAgedNoises = ps.getParameter<edm::ParameterSet>("noises").getParameter<std::vector<double> >("values");
68  double noiseMip = ps.getParameter<edm::ParameterSet>("noiseMip").getParameter<double>("value");
69  bool dependSensor = ps.getParameter<bool>("dependSensor");
70 
71 
72  if(detector=="all") {
73  hits_ee_token = consumes<HGCRecHitCollection>(ps.getParameter<edm::InputTag>("HGCEEInput"));
74  hits_fh_token = consumes<HGCRecHitCollection>(ps.getParameter<edm::InputTag>("HGCFHInput"));
75  hits_bh_token = consumes<HGCRecHitCollection>(ps.getParameter<edm::InputTag>("HGCBHInput"));
77  }else if(detector=="EE") {
78  hits_ee_token = consumes<HGCRecHitCollection>(ps.getParameter<edm::InputTag>("HGCEEInput"));
80  }else if(detector=="FH") {
81  hits_fh_token = consumes<HGCRecHitCollection>(ps.getParameter<edm::InputTag>("HGCFHInput"));
83  } else {
84  hits_bh_token = consumes<HGCRecHitCollection>(ps.getParameter<edm::InputTag>("HGCBHInput"));
86  }
87 
88 
89  if(doSharing){
90  double showerSigma = ps.getParameter<double>("showerSigma");
91  algo = std::make_unique<HGCalImagingAlgo>(vecDeltas, kappa, ecut, showerSigma, algoId, dependSensor, dEdXweights, thicknessCorrection, fcPerMip, fcPerEle, nonAgedNoises, noiseMip, verbosity);
92  }else{
93  algo = std::make_unique<HGCalImagingAlgo>(vecDeltas, kappa, ecut, algoId, dependSensor, dEdXweights, thicknessCorrection, fcPerMip, fcPerEle, nonAgedNoises, noiseMip, verbosity);
94  }
95 
96 
97  produces<std::vector<reco::BasicCluster> >();
98  produces<std::vector<reco::BasicCluster> >("sharing");
99 
100 }
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
reco::CaloCluster::AlgoId algoId
HGCalImagingAlgo::VerbosityLevel verbosity
edm::EDGetTokenT< HGCRecHitCollection > hits_bh_token
edm::EDGetTokenT< HGCRecHitCollection > hits_ee_token
edm::EDGetTokenT< HGCRecHitCollection > hits_fh_token
static const G4double kappa
std::unique_ptr< HGCalImagingAlgo > algo
HGCalLayerClusterProducer::~HGCalLayerClusterProducer ( )
inlineoverride

Definition at line 33 of file HGCalLayerClusterProducer.cc.

References fillDescriptions(), and produce().

33 { }

Member Function Documentation

void HGCalLayerClusterProducer::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 103 of file HGCalLayerClusterProducer.cc.

References edm::ConfigurationDescriptions::add(), edm::ParameterSetDescription::add(), edm::ParameterSetDescription::addUntracked(), and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by ~HGCalLayerClusterProducer().

103  {
104  // hgcalLayerClusters
106  desc.add<std::string>("detector", "all");
107  desc.add<bool>("doSharing", false);
108  desc.add<std::vector<double>>("deltac", {
109  2.0,
110  2.0,
111  5.0,
112  });
113  desc.add<bool>("dependSensor", true);
114  desc.add<double>("ecut", 3.0);
115  desc.add<double>("kappa", 9.0);
116  desc.addUntracked<unsigned int>("verbosity", 3);
117  desc.add<edm::InputTag>("HGCEEInput", edm::InputTag("HGCalRecHit","HGCEERecHits"));
118  desc.add<edm::InputTag>("HGCFHInput", edm::InputTag("HGCalRecHit","HGCHEFRecHits"));
119  desc.add<edm::InputTag>("HGCBHInput", edm::InputTag("HGCalRecHit","HGCHEBRecHits"));
120  desc.add<std::vector<double>>("dEdXweights",{});
121  desc.add<std::vector<double>>("thicknessCorrection",{});
122  desc.add<std::vector<double>>("fcPerMip",{});
123  desc.add<double>("fcPerEle",0.0);
124  edm::ParameterSetDescription descNestedNoises;
125  descNestedNoises.add<std::vector<double> >("values", {});
126  desc.add<edm::ParameterSetDescription>("noises", descNestedNoises);
127  edm::ParameterSetDescription descNestedNoiseMIP;
128  descNestedNoiseMIP.add<double>("value", 0 );
129  desc.add<edm::ParameterSetDescription>("noiseMip", descNestedNoiseMIP);
130  descriptions.add("hgcalLayerClusters", desc);
131 
132 }
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
void HGCalLayerClusterProducer::produce ( edm::Event evt,
const edm::EventSetup es 
)
override

Definition at line 135 of file HGCalLayerClusterProducer.cc.

References algo, algoId, fastPrimaryVertexProducer_cfi::clusters, doSharing, edm::Event::getByToken(), reco::CaloCluster::hgcal_em, reco::CaloCluster::hgcal_had, reco::CaloCluster::hgcal_mixed, hits_bh_token, hits_ee_token, hits_fh_token, mps_fire::i, edm::HandleBase::isValid(), eostools::move(), edm::PtrVector< T >::push_back(), and edm::Event::put().

Referenced by ~HGCalLayerClusterProducer().

136  {
137 
141 
142 
143  std::unique_ptr<std::vector<reco::BasicCluster> > clusters( new std::vector<reco::BasicCluster> ),
144  clusters_sharing( new std::vector<reco::BasicCluster> );
145 
146  algo->reset();
147 
148  algo->getEventSetup(es);
149 
150  switch(algoId){
152  evt.getByToken(hits_ee_token,ee_hits);
153  algo->populate(*ee_hits);
154  break;
156  evt.getByToken(hits_fh_token,fh_hits);
157  evt.getByToken(hits_bh_token,bh_hits);
158  if( fh_hits.isValid() ) {
159  algo->populate(*fh_hits);
160  } else if ( bh_hits.isValid() ) {
161  algo->populate(*bh_hits);
162  }
163  break;
165  evt.getByToken(hits_ee_token,ee_hits);
166  algo->populate(*ee_hits);
167  evt.getByToken(hits_fh_token,fh_hits);
168  algo->populate(*fh_hits);
169  evt.getByToken(hits_bh_token,bh_hits);
170  algo->populate(*bh_hits);
171  break;
172  default:
173  break;
174  }
175  algo->makeClusters();
176  *clusters = algo->getClusters(false);
177  if(doSharing)
178  *clusters_sharing = algo->getClusters(true);
179 
180  auto clusterHandle = evt.put(std::move(clusters));
181  auto clusterHandleSharing = evt.put(std::move(clusters_sharing),"sharing");
182  edm::PtrVector<reco::BasicCluster> clusterPtrs, clusterPtrsSharing;
183  for( unsigned i = 0; i < clusterHandle->size(); ++i ) {
184  edm::Ptr<reco::BasicCluster> ptr(clusterHandle,i);
185  clusterPtrs.push_back(ptr);
186  }
187 
188  if(doSharing){
189  for( unsigned i = 0; i < clusterHandleSharing->size(); ++i ) {
190  edm::Ptr<reco::BasicCluster> ptr(clusterHandleSharing,i);
191  clusterPtrsSharing.push_back(ptr);
192  }
193  }
194 }
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:137
reco::CaloCluster::AlgoId algoId
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:579
void push_back(Ptr< T > const &iPtr)
Definition: PtrVector.h:140
edm::EDGetTokenT< HGCRecHitCollection > hits_bh_token
bool isValid() const
Definition: HandleBase.h:74
edm::EDGetTokenT< HGCRecHitCollection > hits_ee_token
edm::EDGetTokenT< HGCRecHitCollection > hits_fh_token
std::unique_ptr< HGCalImagingAlgo > algo
def move(src, dest)
Definition: eostools.py:510

Member Data Documentation

std::unique_ptr<HGCalImagingAlgo> HGCalLayerClusterProducer::algo
private

Definition at line 46 of file HGCalLayerClusterProducer.cc.

Referenced by HGCalLayerClusterProducer(), and produce().

reco::CaloCluster::AlgoId HGCalLayerClusterProducer::algoId
private

Definition at line 44 of file HGCalLayerClusterProducer.cc.

Referenced by HGCalLayerClusterProducer(), and produce().

std::string HGCalLayerClusterProducer::detector
private

Definition at line 48 of file HGCalLayerClusterProducer.cc.

Referenced by HGCalLayerClusterProducer().

bool HGCalLayerClusterProducer::doSharing
private

Definition at line 47 of file HGCalLayerClusterProducer.cc.

Referenced by HGCalLayerClusterProducer(), and produce().

edm::EDGetTokenT<HGCRecHitCollection> HGCalLayerClusterProducer::hits_bh_token
private

Definition at line 42 of file HGCalLayerClusterProducer.cc.

Referenced by HGCalLayerClusterProducer(), and produce().

edm::EDGetTokenT<HGCRecHitCollection> HGCalLayerClusterProducer::hits_ee_token
private

Definition at line 40 of file HGCalLayerClusterProducer.cc.

Referenced by HGCalLayerClusterProducer(), and produce().

edm::EDGetTokenT<HGCRecHitCollection> HGCalLayerClusterProducer::hits_fh_token
private

Definition at line 41 of file HGCalLayerClusterProducer.cc.

Referenced by HGCalLayerClusterProducer(), and produce().

HGCalImagingAlgo::VerbosityLevel HGCalLayerClusterProducer::verbosity
private

Definition at line 50 of file HGCalLayerClusterProducer.cc.

Referenced by HGCalLayerClusterProducer().