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_) {
103 useConversions_ = iConfig.
getParameter<
bool>(
"useConversions");
105 useConvBremGsfTracks_ = iConfig.
getParameter<
bool>(
"useConvBremGsfTracks");
107 bool useConvBremPFRecTracks = iConfig.
getParameter<
bool>(
"useConvBremPFRecTracks");
113 produces<reco::PFBlockCollection>();
116 useKDTreeTrackEcalLinker_ = iConfig.
getParameter<
bool>(
"useKDTreeTrackEcalLinker");
121 std::vector<double> DPtovPtCut
122 = iConfig.
getParameter<std::vector<double> >(
"pf_DPtoverPt_Cut");
123 if (DPtovPtCut.size()!=5)
125 edm::LogError(
"MisConfiguration")<<
" vector pf_DPtoverPt_Cut has to be of size 5";
129 std::vector<unsigned> NHitCut
130 = iConfig.
getParameter<std::vector<unsigned> >(
"pf_NHit_Cut");
131 if (NHitCut.size()!=5)
133 edm::LogError(
"MisConfiguration")<<
" vector pf_NHit_Cut has to be of size 5";
140 int nuclearInteractionsPurity
141 = iConfig.
getParameter<
unsigned>(
"nuclearInteractionsPurity");
144 std::vector<double> EGPhotonSelectionCuts ;
147 EGPhotonSelectionCuts = iConfig.
getParameter<std::vector<double> >(
"PhotonSelectionCuts");
151 if (nuclearInteractionsPurity > 3 || nuclearInteractionsPurity < 1) {
152 nuclearInteractionsPurity = 1;
153 edm::LogInfo(
"PFBlockProducer") <<
"NI purity not properly implemented. Set it to the strongest level " << nuclearInteractionsPurity << endl;
155 vector<string> securityLevel;
156 securityLevel.push_back(
"isNucl"); securityLevel.push_back(
"isNucl && isNuclLoose"); securityLevel.push_back(
"isNucl && isNuclLoose && isNuclKink");
157 edm::LogInfo(
"PFBlockProducer") <<
"NI interactions are corrected in PFlow for " << securityLevel[nuclearInteractionsPurity-1].c_str() << endl;
161 pfBlockAlgo_.setParameters( DPtovPtCut,
163 useConvBremPFRecTracks,
165 nuclearInteractionsPurity,
167 EGPhotonSelectionCuts,
171 pfBlockAlgo_.setDebug(debug_);
174 pfBlockAlgo_.setUseOptimization(useKDTreeTrackEcalLinker_);
178 pfBlockAlgo_.setHOTag(useHO_);
193 <<
" in run "<<iEvent.
id().
run()<<endl;
204 LogError(
"PFBlockProducer")<<
" cannot get rectracks: "
205 <<inputTagRecTracks_<<endl;
213 found = iEvent.
getByLabel(inputTagGsfRecTracks_,GsfrecTracks);
216 LogError(
"PFBlockProducer")<<
" cannot get Gsfrectracks: "
217 << inputTagGsfRecTracks_ <<endl;
223 if(useConvBremGsfTracks_) {
224 found = iEvent.
getByLabel(inputTagConvBremGsfRecTracks_,convBremGsfrecTracks);
227 LogError(
"PFBlockProducer")<<
" cannot get ConvBremGsfrectracks: "
228 << inputTagConvBremGsfRecTracks_ <<endl;
236 found = iEvent.
getByLabel(inputTagRecMuons_, recMuons);
250 found = iEvent.
getByLabel(inputTagPFNuclear_, pfNuclears);
252 LogError(
"PFBlockProducer")<<
" cannot get PFNuclearInteractions : "
253 <<inputTagPFNuclear_<<endl;
258 if( useConversions_ ) {
259 found = iEvent.
getByLabel(inputTagPFConversions_, pfConversions);
262 LogError(
"PFBlockProducer")<<
" cannot get PFConversions : "
263 <<inputTagPFConversions_<<endl;
270 found = iEvent.
getByLabel(inputTagPFV0_, pfV0);
273 LogError(
"PFBlockProducer")<<
" cannot get PFV0 : "
274 <<inputTagPFV0_<<endl;
283 found = iEvent.
getByLabel(inputTagPFClustersECAL_,
286 LogError(
"PFBlockProducer")<<
" cannot get ECAL clusters: "
287 <<inputTagPFClustersECAL_<<endl;
291 found = iEvent.
getByLabel(inputTagPFClustersHCAL_,
294 LogError(
"PFBlockProducer")<<
" cannot get HCAL clusters: "
295 <<inputTagPFClustersHCAL_<<endl;
299 found = iEvent.
getByLabel(inputTagPFClustersHO_,
302 LogError(
"PFBlockProducer")<<
" cannot get HO clusters: "
303 <<inputTagPFClustersHO_<<endl;
307 found = iEvent.
getByLabel(inputTagPFClustersHFEM_,
310 LogError(
"PFBlockProducer")<<
" cannot get HFEM clusters: "
311 <<inputTagPFClustersHFEM_<<endl;
314 found = iEvent.
getByLabel(inputTagPFClustersHFHAD_,
317 LogError(
"PFBlockProducer")<<
" cannot get HFHAD clusters: "
318 <<inputTagPFClustersHFHAD_<<endl;
322 found = iEvent.
getByLabel(inputTagPFClustersPS_,
325 LogError(
"PFBlockProducer")<<
" cannot get PS clusters: "
326 <<inputTagPFClustersPS_<<endl;
336 if(!found && useEGPhotons_ )
337 LogError(
"PFBlockProducer")<<
" cannot get photons"
338 << inputTagEGPhotons_ << endl;
343 if (useSuperClusters_) {
348 LogError(
"PFBlockProducer")<<
" cannot get sceb"
349 << inputTagSCBarrel_ << endl;
357 LogError(
"PFBlockProducer")<<
" cannot get scee"
358 << inputTagSCEndcap_ << endl;
363 pfBlockAlgo_.setInput( recTracks,
372 pfBlockAlgo_.setInput( recTracks,
374 convBremGsfrecTracks,
390 pfBlockAlgo_.findBlocks();
394 str<<pfBlockAlgo_<<endl;
395 LogInfo(
"PFBlockProducer") << str.str()<<endl;
398 auto_ptr< reco::PFBlockCollection >
399 pOutputBlockCollection( pfBlockAlgo_.transferBlocks() );
401 iEvent.
put(pOutputBlockCollection);
404 <<
" 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