44 inputTagConvBremGsfRecTracks_
53 inputTagPFConversions_
59 inputTagPFClustersECAL_
62 inputTagPFClustersHCAL_
68 inputTagPFClustersHFEM_
71 inputTagPFClustersHFHAD_
77 useEGPhotons_ = iConfig.
getParameter<
bool>(
"useEGPhotons");
84 useSuperClusters_ = iConfig.
existsAs<
bool>(
"useSuperClusters") ? iConfig.
getParameter<
bool>(
"useSuperClusters") :
false;
86 if (useSuperClusters_) {
94 superClusterMatchByRef_ = iConfig.
existsAs<
bool>(
"SuperClusterMatchByRef") ? iConfig.
getParameter<
bool>(
"SuperClusterMatchByRef") :
false;
96 if (superClusterMatchByRef_) {
110 useConversions_ = iConfig.
getParameter<
bool>(
"useConversions");
112 useConvBremGsfTracks_ = iConfig.
getParameter<
bool>(
"useConvBremGsfTracks");
114 bool useConvBremPFRecTracks = iConfig.
getParameter<
bool>(
"useConvBremPFRecTracks");
120 produces<reco::PFBlockCollection>();
123 useKDTreeTrackEcalLinker_ = iConfig.
getParameter<
bool>(
"useKDTreeTrackEcalLinker");
128 std::vector<double> DPtovPtCut
129 = iConfig.
getParameter<std::vector<double> >(
"pf_DPtoverPt_Cut");
130 if (DPtovPtCut.size()!=5)
132 edm::LogError(
"MisConfiguration")<<
" vector pf_DPtoverPt_Cut has to be of size 5";
136 std::vector<unsigned> NHitCut
137 = iConfig.
getParameter<std::vector<unsigned> >(
"pf_NHit_Cut");
138 if (NHitCut.size()!=5)
140 edm::LogError(
"MisConfiguration")<<
" vector pf_NHit_Cut has to be of size 5";
147 int nuclearInteractionsPurity
148 = iConfig.
getParameter<
unsigned>(
"nuclearInteractionsPurity");
151 std::vector<double> EGPhotonSelectionCuts ;
154 EGPhotonSelectionCuts = iConfig.
getParameter<std::vector<double> >(
"PhotonSelectionCuts");
158 if (nuclearInteractionsPurity > 3 || nuclearInteractionsPurity < 1) {
159 nuclearInteractionsPurity = 1;
160 edm::LogInfo(
"PFBlockProducer") <<
"NI purity not properly implemented. Set it to the strongest level " << nuclearInteractionsPurity << endl;
162 vector<string> securityLevel;
163 securityLevel.push_back(
"isNucl"); securityLevel.push_back(
"isNucl && isNuclLoose"); securityLevel.push_back(
"isNucl && isNuclLoose && isNuclKink");
164 edm::LogInfo(
"PFBlockProducer") <<
"NI interactions are corrected in PFlow for " << securityLevel[nuclearInteractionsPurity-1].c_str() << endl;
168 pfBlockAlgo_.setParameters( DPtovPtCut,
170 useConvBremPFRecTracks,
172 nuclearInteractionsPurity,
174 EGPhotonSelectionCuts,
176 superClusterMatchByRef_
179 pfBlockAlgo_.setDebug(debug_);
182 pfBlockAlgo_.setUseOptimization(useKDTreeTrackEcalLinker_);
186 pfBlockAlgo_.setHOTag(useHO_);
201 <<
" in run "<<iEvent.
id().
run()<<endl;
212 LogError(
"PFBlockProducer")<<
" cannot get rectracks: "
213 <<inputTagRecTracks_<<endl;
221 found = iEvent.
getByLabel(inputTagGsfRecTracks_,GsfrecTracks);
224 LogError(
"PFBlockProducer")<<
" cannot get Gsfrectracks: "
225 << inputTagGsfRecTracks_ <<endl;
231 if(useConvBremGsfTracks_) {
232 found = iEvent.
getByLabel(inputTagConvBremGsfRecTracks_,convBremGsfrecTracks);
235 LogError(
"PFBlockProducer")<<
" cannot get ConvBremGsfrectracks: "
236 << inputTagConvBremGsfRecTracks_ <<endl;
244 found = iEvent.
getByLabel(inputTagRecMuons_, recMuons);
258 found = iEvent.
getByLabel(inputTagPFNuclear_, pfNuclears);
260 LogError(
"PFBlockProducer")<<
" cannot get PFNuclearInteractions : "
261 <<inputTagPFNuclear_<<endl;
266 if( useConversions_ ) {
267 found = iEvent.
getByLabel(inputTagPFConversions_, pfConversions);
270 LogError(
"PFBlockProducer")<<
" cannot get PFConversions : "
271 <<inputTagPFConversions_<<endl;
278 found = iEvent.
getByLabel(inputTagPFV0_, pfV0);
281 LogError(
"PFBlockProducer")<<
" cannot get PFV0 : "
282 <<inputTagPFV0_<<endl;
291 found = iEvent.
getByLabel(inputTagPFClustersECAL_,
294 LogError(
"PFBlockProducer")<<
" cannot get ECAL clusters: "
295 <<inputTagPFClustersECAL_<<endl;
299 found = iEvent.
getByLabel(inputTagPFClustersHCAL_,
302 LogError(
"PFBlockProducer")<<
" cannot get HCAL clusters: "
303 <<inputTagPFClustersHCAL_<<endl;
307 found = iEvent.
getByLabel(inputTagPFClustersHO_,
310 LogError(
"PFBlockProducer")<<
" cannot get HO clusters: "
311 <<inputTagPFClustersHO_<<endl;
315 found = iEvent.
getByLabel(inputTagPFClustersHFEM_,
318 LogError(
"PFBlockProducer")<<
" cannot get HFEM clusters: "
319 <<inputTagPFClustersHFEM_<<endl;
322 found = iEvent.
getByLabel(inputTagPFClustersHFHAD_,
325 LogError(
"PFBlockProducer")<<
" cannot get HFHAD clusters: "
326 <<inputTagPFClustersHFHAD_<<endl;
330 found = iEvent.
getByLabel(inputTagPFClustersPS_,
333 LogError(
"PFBlockProducer")<<
" cannot get PS clusters: "
334 <<inputTagPFClustersPS_<<endl;
344 if(!found && useEGPhotons_ )
345 LogError(
"PFBlockProducer")<<
" cannot get photons"
346 << inputTagEGPhotons_ << endl;
351 if (useSuperClusters_) {
356 LogError(
"PFBlockProducer")<<
" cannot get sceb"
357 << inputTagSCBarrel_ << endl;
365 LogError(
"PFBlockProducer")<<
" cannot get scee"
366 << inputTagSCEndcap_ << endl;
371 if (superClusterMatchByRef_) {
372 found = iEvent.
getByLabel(inputTagPFClusterAssociationEBEE_,
376 LogError(
"PFBlockProducer")<<
" cannot get PFCluster Association"
377 << inputTagPFClusterAssociationEBEE_ << endl;
381 pfBlockAlgo_.setInput( recTracks,
390 pfBlockAlgo_.setInput( recTracks,
392 convBremGsfrecTracks,
410 pfBlockAlgo_.findBlocks();
414 str<<pfBlockAlgo_<<endl;
415 LogInfo(
"PFBlockProducer") << str.str()<<endl;
418 auto_ptr< reco::PFBlockCollection >
419 pOutputBlockCollection( pfBlockAlgo_.transferBlocks() );
421 iEvent.
put(pOutputBlockCollection);
424 <<
" in run "<<iEvent.
id().
run()<<endl;
T getParameter(std::string const &) const
EventNumber_t event() const
T getUntrackedParameter(std::string const &, T const &) const
virtual void produce(edm::Event &, const edm::EventSetup &) override
bool existsAs(std::string const ¶meterName, bool trackiness=true) const
checks if a parameter exists as a given type
PFBlockProducer(const edm::ParameterSet &)
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const