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

Producer for particle flow reconstructed particles (PFCandidates) More...

#include <PFProducer.h>

Inheritance diagram for PFProducer:
edm::EDProducer edm::ProducerBase edm::ProductRegistryHelper

Public Member Functions

virtual void beginJob ()
 
virtual void beginRun (edm::Run &, const edm::EventSetup &)
 
 PFProducer (const edm::ParameterSet &)
 
virtual void produce (edm::Event &, const edm::EventSetup &)
 
 ~PFProducer ()
 
- Public Member Functions inherited from edm::EDProducer
 EDProducer ()
 
virtual ~EDProducer ()
 
- Public Member Functions inherited from edm::ProducerBase
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
boost::function< void(const
BranchDescription &)> 
registrationCallback () const
 used by the fwk to register list of products More...
 
virtual ~ProducerBase ()
 

Private Attributes

std::string electronExtraOutputCol_
 
std::string electronOutputCol_
 
edm::InputTag inputTagBlocks_
 
std::vector< edm::InputTaginputTagCleanedHF_
 
edm::InputTag inputTagEgammaElectrons_
 
edm::InputTag inputTagMuons_
 
std::auto_ptr< PFAlgopfAlgo_
 particle flow algorithm More...
 
bool postMuonCleaning_
 
bool useCalibrationsFromDB_
 
bool useEGammaElectrons_
 
bool usePFElectrons_
 
bool usePFPhotons_
 
bool useVerticesForNeutral_
 
bool verbose_
 verbose ? More...
 
edm::InputTag vertices_
 

Additional Inherited Members

- Public Types inherited from edm::EDProducer
typedef EDProducer ModuleType
 
typedef WorkerT< EDProducerWorkerType
 
- Public Types inherited from edm::ProducerBase
typedef
ProductRegistryHelper::TypeLabelList 
TypeLabelList
 
- Static Public Member Functions inherited from edm::EDProducer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from edm::EDProducer
CurrentProcessingContext const * currentContext () const
 
- Protected Member Functions inherited from edm::ProducerBase
template<class TProducer , class TMethod >
void callWhenNewProductsRegistered (TProducer *iProd, TMethod iMethod)
 

Detailed Description

Producer for particle flow reconstructed particles (PFCandidates)

This producer makes use of PFAlgo, the particle flow algorithm.

Author
Colin Bernet
Date
July 2006

Definition at line 29 of file PFProducer.h.

Constructor & Destructor Documentation

PFProducer::PFProducer ( const edm::ParameterSet iConfig)
explicit

Definition at line 27 of file PFProducer.cc.

References edm::ParameterSet::getParameter(), and edm::ParameterSet::getUntrackedParameter().

27  {
28 
29  //--ab: get calibration factors for HF:
30  bool calibHF_use;
31  std::vector<double> calibHF_eta_step;
32  std::vector<double> calibHF_a_EMonly;
33  std::vector<double> calibHF_b_HADonly;
34  std::vector<double> calibHF_a_EMHAD;
35  std::vector<double> calibHF_b_EMHAD;
36  calibHF_use = iConfig.getParameter<bool>("calibHF_use");
37  calibHF_eta_step = iConfig.getParameter<std::vector<double> >("calibHF_eta_step");
38  calibHF_a_EMonly = iConfig.getParameter<std::vector<double> >("calibHF_a_EMonly");
39  calibHF_b_HADonly = iConfig.getParameter<std::vector<double> >("calibHF_b_HADonly");
40  calibHF_a_EMHAD = iConfig.getParameter<std::vector<double> >("calibHF_a_EMHAD");
41  calibHF_b_EMHAD = iConfig.getParameter<std::vector<double> >("calibHF_b_EMHAD");
42  boost::shared_ptr<PFEnergyCalibrationHF>
43  thepfEnergyCalibrationHF ( new PFEnergyCalibrationHF(calibHF_use,calibHF_eta_step,calibHF_a_EMonly,calibHF_b_HADonly,calibHF_a_EMHAD,calibHF_b_EMHAD) ) ;
44  //-----------------
45 
47  = iConfig.getParameter<InputTag>("blocks");
48 
49  //Post cleaning of the muons
51  = iConfig.getParameter<InputTag>("muons");
53  = iConfig.getParameter<bool>("postMuonCleaning");
54 
56  = iConfig.getParameter<bool>("usePFElectrons");
57 
59  = iConfig.getParameter<bool>("usePFPhotons");
60 
62  = iConfig.getParameter<bool>("useEGammaElectrons");
63 
64  if( useEGammaElectrons_) {
65  inputTagEgammaElectrons_ = iConfig.getParameter<edm::InputTag>("egammaElectrons");
66  }
67 
69  = iConfig.getParameter<std::string>("pf_electron_output_col");
70 
71  bool usePFSCEleCalib;
72  std::vector<double> calibPFSCEle_Fbrem_barrel;
73  std::vector<double> calibPFSCEle_Fbrem_endcap;
74  std::vector<double> calibPFSCEle_barrel;
75  std::vector<double> calibPFSCEle_endcap;
76  usePFSCEleCalib = iConfig.getParameter<bool>("usePFSCEleCalib");
77  calibPFSCEle_Fbrem_barrel = iConfig.getParameter<std::vector<double> >("calibPFSCEle_Fbrem_barrel");
78  calibPFSCEle_Fbrem_endcap = iConfig.getParameter<std::vector<double> >("calibPFSCEle_Fbrem_endcap");
79  calibPFSCEle_barrel = iConfig.getParameter<std::vector<double> >("calibPFSCEle_barrel");
80  calibPFSCEle_endcap = iConfig.getParameter<std::vector<double> >("calibPFSCEle_endcap");
81  boost::shared_ptr<PFSCEnergyCalibration>
82  thePFSCEnergyCalibration ( new PFSCEnergyCalibration(calibPFSCEle_Fbrem_barrel,calibPFSCEle_Fbrem_endcap,
83  calibPFSCEle_barrel,calibPFSCEle_endcap ));
84 
85  bool useEGammaSupercluster = iConfig.getParameter<bool>("useEGammaSupercluster");
86  double sumEtEcalIsoForEgammaSC_barrel = iConfig.getParameter<double>("sumEtEcalIsoForEgammaSC_barrel");
87  double sumEtEcalIsoForEgammaSC_endcap = iConfig.getParameter<double>("sumEtEcalIsoForEgammaSC_endcap");
88  double coneEcalIsoForEgammaSC = iConfig.getParameter<double>("coneEcalIsoForEgammaSC");
89  double sumPtTrackIsoForEgammaSC_barrel = iConfig.getParameter<double>("sumPtTrackIsoForEgammaSC_barrel");
90  double sumPtTrackIsoForEgammaSC_endcap = iConfig.getParameter<double>("sumPtTrackIsoForEgammaSC_endcap");
91  double coneTrackIsoForEgammaSC = iConfig.getParameter<double>("coneTrackIsoForEgammaSC");
92  unsigned int nTrackIsoForEgammaSC = iConfig.getParameter<unsigned int>("nTrackIsoForEgammaSC");
93 
94 
95  // register products
96  produces<reco::PFCandidateCollection>();
97  produces<reco::PFCandidateCollection>("CleanedHF");
98  produces<reco::PFCandidateCollection>("CleanedCosmicsMuons");
99  produces<reco::PFCandidateCollection>("CleanedTrackerAndGlobalMuons");
100  produces<reco::PFCandidateCollection>("CleanedFakeMuons");
101  produces<reco::PFCandidateCollection>("CleanedPunchThroughMuons");
102  produces<reco::PFCandidateCollection>("CleanedPunchThroughNeutralHadrons");
103  produces<reco::PFCandidateCollection>("AddedMuonsAndHadrons");
104 
105 
106  if (usePFElectrons_) {
107  produces<reco::PFCandidateCollection>(electronOutputCol_);
108  produces<reco::PFCandidateElectronExtraCollection>(electronExtraOutputCol_);
109  }
110 
111  double nSigmaECAL
112  = iConfig.getParameter<double>("pf_nsigma_ECAL");
113  double nSigmaHCAL
114  = iConfig.getParameter<double>("pf_nsigma_HCAL");
115 
116  //PFElectrons Configuration
117  double mvaEleCut
118  = iConfig.getParameter<double>("pf_electron_mvaCut");
119 
120  string mvaWeightFileEleID
121  = iConfig.getParameter<string>("pf_electronID_mvaWeightFile");
122 
123  bool applyCrackCorrectionsForElectrons
124  = iConfig.getParameter<bool>("pf_electronID_crackCorrection");
125 
126  string path_mvaWeightFileEleID;
127  if(usePFElectrons_)
128  {
129  path_mvaWeightFileEleID = edm::FileInPath ( mvaWeightFileEleID.c_str() ).fullPath();
130  }
131 
132  //PFPhoton Configuration
133 
134  string path_mvaWeightFileConvID;
135  string mvaWeightFileConvID;
136  double mvaConvCut=-99.;
137  if(usePFPhotons_)
138  {
139  mvaWeightFileConvID =iConfig.getParameter<string>("pf_convID_mvaWeightFile");
140 
141  mvaConvCut = iConfig.getParameter<double>("pf_conv_mvaCut");
142  path_mvaWeightFileConvID = edm::FileInPath ( mvaWeightFileConvID.c_str() ).fullPath();
143  }
144 
145 
146  //Secondary tracks and displaced vertices parameters
147 
148  bool rejectTracks_Bad
149  = iConfig.getParameter<bool>("rejectTracks_Bad");
150 
151  bool rejectTracks_Step45
152  = iConfig.getParameter<bool>("rejectTracks_Step45");
153 
154  bool usePFNuclearInteractions
155  = iConfig.getParameter<bool>("usePFNuclearInteractions");
156 
157  bool usePFConversions
158  = iConfig.getParameter<bool>("usePFConversions");
159 
160  bool usePFDecays
161  = iConfig.getParameter<bool>("usePFDecays");
162 
163  double dptRel_DispVtx
164  = iConfig.getParameter<double>("dptRel_DispVtx");
165 
166  edm::ParameterSet iCfgCandConnector
167  = iConfig.getParameter<edm::ParameterSet>("iCfgCandConnector");
168 
169 
170  // fToRead = iConfig.getUntrackedParameter<vector<string> >("toRead");
171 
173  = iConfig.getParameter<bool>("useCalibrationsFromDB");
174 
175  boost::shared_ptr<PFEnergyCalibration>
176  calibration( new PFEnergyCalibration() );
177 
178  int algoType
179  = iConfig.getParameter<unsigned>("algoType");
180 
181  switch(algoType) {
182  case 0:
183  pfAlgo_.reset( new PFAlgo);
184  break;
185  default:
186  assert(0);
187  }
188 
189  pfAlgo_->setParameters( nSigmaECAL,
190  nSigmaHCAL,
191  calibration,
192  thepfEnergyCalibrationHF);
193 
194  //PFElectrons: call the method setpfeleparameters
195  pfAlgo_->setPFEleParameters(mvaEleCut,
196  path_mvaWeightFileEleID,
197  usePFElectrons_,
198  thePFSCEnergyCalibration,
199  calibration,
200  sumEtEcalIsoForEgammaSC_barrel,
201  sumEtEcalIsoForEgammaSC_endcap,
202  coneEcalIsoForEgammaSC,
203  sumPtTrackIsoForEgammaSC_barrel,
204  sumPtTrackIsoForEgammaSC_endcap,
205  nTrackIsoForEgammaSC,
206  coneTrackIsoForEgammaSC,
207  applyCrackCorrectionsForElectrons,
208  usePFSCEleCalib,
209  useEGammaElectrons_,
210  useEGammaSupercluster);
211 
212  // pfAlgo_->setPFConversionParameters(usePFConversions);
213 
214  // PFPhotons:
215  pfAlgo_->setPFPhotonParameters(usePFPhotons_,
216  path_mvaWeightFileConvID,
217  mvaConvCut,
218  calibration);
219 
220 
221  //Secondary tracks and displaced vertices parameters
222 
223  pfAlgo_->setDisplacedVerticesParameters(rejectTracks_Bad,
224  rejectTracks_Step45,
225  usePFNuclearInteractions,
226  usePFConversions,
227  usePFDecays,
228  dptRel_DispVtx);
229 
230  if (usePFNuclearInteractions)
231  pfAlgo_->setCandConnectorParameters( iCfgCandConnector );
232 
233  // Muon parameters
234  std::vector<double> muonHCAL
235  = iConfig.getParameter<std::vector<double> >("muon_HCAL");
236  std::vector<double> muonECAL
237  = iConfig.getParameter<std::vector<double> >("muon_ECAL");
238  assert ( muonHCAL.size() == 2 && muonECAL.size() == 2 );
239 
240  // Fake track parameters
241  double nSigmaTRACK
242  = iConfig.getParameter<double>("nsigma_TRACK");
243 
244  double ptError
245  = iConfig.getParameter<double>("pt_Error");
246 
247  std::vector<double> factors45
248  = iConfig.getParameter<std::vector<double> >("factors_45");
249  assert ( factors45.size() == 2 );
250 
251  bool usePFMuonMomAssign
252  = iConfig.getParameter<bool>("usePFMuonMomAssign");
253 
254  // Set muon and fake track parameters
255  pfAlgo_->setPFMuonAndFakeParameters(muonHCAL,
256  muonECAL,
257  nSigmaTRACK,
258  ptError,
259  factors45,
260  usePFMuonMomAssign);
261 
262  //Post cleaning of the HF
263  bool postHFCleaning
264  = iConfig.getParameter<bool>("postHFCleaning");
265 
266  double minHFCleaningPt
267  = iConfig.getParameter<double>("minHFCleaningPt");
268  double minSignificance
269  = iConfig.getParameter<double>("minSignificance");
270  double maxSignificance
271  = iConfig.getParameter<double>("maxSignificance");
272  double minSignificanceReduction
273  = iConfig.getParameter<double>("minSignificanceReduction");
274  double maxDeltaPhiPt
275  = iConfig.getParameter<double>("maxDeltaPhiPt");
276  double minDeltaMet
277  = iConfig.getParameter<double>("minDeltaMet");
278 
279  // Set post HF cleaning muon parameters
280  pfAlgo_->setPostHFCleaningParameters(postHFCleaning,
281  minHFCleaningPt,
282  minSignificance,
283  maxSignificance,
284  minSignificanceReduction,
285  maxDeltaPhiPt,
286  minDeltaMet);
287 
288  // Input tags for HF cleaned rechits
290  = iConfig.getParameter< std::vector<edm::InputTag> >("cleanedHF");
291 
292  //MIKE: Vertex Parameters
293  vertices_ = iConfig.getParameter<edm::InputTag>("vertexCollection");
294  useVerticesForNeutral_ = iConfig.getParameter<bool>("useVerticesForNeutral");
295 
296 
297 
298  verbose_ =
299  iConfig.getUntrackedParameter<bool>("verbose",false);
300 
301  bool debug_ =
302  iConfig.getUntrackedParameter<bool>("debug",false);
303 
304  pfAlgo_->setDebug( debug_ );
305 
306 }
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
std::auto_ptr< PFAlgo > pfAlgo_
particle flow algorithm
Definition: PFProducer.h:73
edm::InputTag inputTagMuons_
Definition: PFProducer.h:41
std::vector< edm::InputTag > inputTagCleanedHF_
Definition: PFProducer.h:44
bool useCalibrationsFromDB_
Definition: PFProducer.h:67
bool useVerticesForNeutral_
Definition: PFProducer.h:64
edm::InputTag vertices_
Definition: PFProducer.h:42
bool postMuonCleaning_
Definition: PFProducer.h:52
edm::InputTag inputTagBlocks_
Definition: PFProducer.h:40
bool usePFElectrons_
Definition: PFProducer.h:55
edm::InputTag inputTagEgammaElectrons_
Definition: PFProducer.h:43
std::string electronOutputCol_
Definition: PFProducer.h:45
bool verbose_
verbose ?
Definition: PFProducer.h:49
std::string electronExtraOutputCol_
Definition: PFProducer.h:46
bool useEGammaElectrons_
Definition: PFProducer.h:61
bool usePFPhotons_
Definition: PFProducer.h:58
Definition: PFAlgo.h:46
PFProducer::~PFProducer ( )

Definition at line 310 of file PFProducer.cc.

310 {}

Member Function Documentation

void PFProducer::beginJob ( void  )
virtual

Reimplemented from edm::EDProducer.

Definition at line 314 of file PFProducer.cc.

314 {}
void PFProducer::beginRun ( edm::Run run,
const edm::EventSetup es 
)
virtual

Reimplemented from edm::EDProducer.

Definition at line 317 of file PFProducer.cc.

References edm::EventSetup::get(), and edm::ESHandle< class >::product().

319 {
320 
321 
322  /*
323  static map<string, PerformanceResult::ResultType> functType;
324 
325  functType["PFfa_BARREL"] = PerformanceResult::PFfa_BARREL;
326  functType["PFfa_ENDCAP"] = PerformanceResult::PFfa_ENDCAP;
327  functType["PFfb_BARREL"] = PerformanceResult::PFfb_BARREL;
328  functType["PFfb_ENDCAP"] = PerformanceResult::PFfb_ENDCAP;
329  functType["PFfc_BARREL"] = PerformanceResult::PFfc_BARREL;
330  functType["PFfc_ENDCAP"] = PerformanceResult::PFfc_ENDCAP;
331  functType["PFfaEta_BARREL"] = PerformanceResult::PFfaEta_BARREL;
332  functType["PFfaEta_ENDCAP"] = PerformanceResult::PFfaEta_ENDCAP;
333  functType["PFfbEta_BARREL"] = PerformanceResult::PFfbEta_BARREL;
334  functType["PFfbEta_ENDCAP"] = PerformanceResult::PFfbEta_ENDCAP;
335  */
336 
337  if ( useCalibrationsFromDB_ ) {
338  // Read the PFCalibration functions from the global tags.
340  es.get<PFCalibrationRcd>().get(perfH);
341 
342  const PerformancePayloadFromTFormula *pfCalibrations = static_cast< const PerformancePayloadFromTFormula *>(perfH.product());
343 
344  pfAlgo_->thePFEnergyCalibration()->setCalibrationFunctions(pfCalibrations);
345  }
346 
347  /*
348  for(vector<string>::const_iterator name = fToRead.begin(); name != fToRead.end(); ++name) {
349 
350  cout << "Function: " << *name << endl;
351  PerformanceResult::ResultType fType = functType[*name];
352  pfCalibrations->printFormula(fType);
353 
354  // evaluate it @ 10 GeV
355  float energy = 10.;
356 
357  BinningPointByMap point;
358  point.insert(BinningVariables::JetEt, energy);
359 
360  if(pfCalibrations->isInPayload(fType, point)) {
361  float value = pfCalibrations->getResult(fType, point);
362  cout << " Energy before:: " << energy << " after: " << value << endl;
363  } else cout << "outside limits!" << endl;
364 
365  }
366  */
367 
368 }
std::auto_ptr< PFAlgo > pfAlgo_
particle flow algorithm
Definition: PFProducer.h:73
bool useCalibrationsFromDB_
Definition: PFProducer.h:67
const T & get() const
Definition: EventSetup.h:55
T const * product() const
Definition: ESHandle.h:62
void PFProducer::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
virtual

Implements edm::EDProducer.

Definition at line 372 of file PFProducer.cc.

References runregparse::blocks, gather_cfg::cout, edm::EventID::event(), edm::hlt::Exception, newFWLiteAna::found, edm::Event::getByLabel(), edm::EventBase::id(), edm::HandleBase::isValid(), LogDebug, patZpeak::muons, edm::Event::put(), and edm::EventID::run().

373  {
374 
375  LogDebug("PFProducer")<<"START event: "
376  <<iEvent.id().event()
377  <<" in run "<<iEvent.id().run()<<endl;
378 
379 
380  // Get The vertices from the event
381  // and assign dynamic vertex parameters
383  bool gotVertices = iEvent.getByLabel(vertices_,vertices);
384  if(!gotVertices) {
385  ostringstream err;
386  err<<"Cannot find vertices for this event.Continuing Without them ";
387  LogError("PFProducer")<<err.str()<<endl;
388  }
389 
390  //Assign the PFAlgo Parameters
391  pfAlgo_->setPFVertexParameters(useVerticesForNeutral_,*vertices);
392 
393  // get the collection of blocks
394 
396 
397  LogDebug("PFProducer")<<"getting blocks"<<endl;
398  bool found = iEvent.getByLabel( inputTagBlocks_, blocks );
399 
400  if(!found ) {
401 
402  ostringstream err;
403  err<<"cannot find blocks: "<<inputTagBlocks_;
404  LogError("PFProducer")<<err.str()<<endl;
405 
406  throw cms::Exception( "MissingProduct", err.str());
407  }
408 
409  // get the collection of muons
410 
412 
413  if ( postMuonCleaning_ ) {
414 
415  LogDebug("PFProducer")<<"getting muons"<<endl;
416  found = iEvent.getByLabel( inputTagMuons_, muons );
417 
418  if(!found) {
419  ostringstream err;
420  err<<"cannot find muons: "<<inputTagMuons_;
421  LogError("PFProducer")<<err.str()<<endl;
422 
423  throw cms::Exception( "MissingProduct", err.str());
424  }
425 
426  }
427 
428  if (useEGammaElectrons_) {
430 
431  LogDebug("PFProducer")<<" Reading e/gamma electrons activated "<<endl;
432  found = iEvent.getByLabel( inputTagEgammaElectrons_, egelectrons );
433 
434  if(!found) {
435  ostringstream err;
436  err<<"cannot find electrons: "<<inputTagEgammaElectrons_;
437  LogError("PFProducer")<<err.str()<<endl;
438 
439  throw cms::Exception( "MissingProduct", err.str());
440  }
441 
442  pfAlgo_->setEGElectronCollection(*egelectrons);
443  }
444 
445 
446  LogDebug("PFProducer")<<"particle flow is starting"<<endl;
447 
448  assert( blocks.isValid() );
449 
450  pfAlgo_->reconstructParticles( blocks );
451 
452  if(verbose_) {
453  ostringstream str;
454  str<<(*pfAlgo_)<<endl;
455  // cout << (*pfAlgo_) << endl;
456  LogInfo("PFProducer") <<str.str()<<endl;
457  }
458 
459 
460  if ( postMuonCleaning_ )
461  pfAlgo_->postMuonCleaning( muons, *vertices );
462 
463  // Florian 5/01/2011
464  // Save the PFElectron Extra Collection First as to be able to create valid References
465  if(usePFElectrons_) {
466  auto_ptr< reco::PFCandidateElectronExtraCollection >
467  pOutputElectronCandidateExtraCollection( pfAlgo_->transferElectronExtra() );
468 
470  iEvent.put(pOutputElectronCandidateExtraCollection,electronExtraOutputCol_);
471  pfAlgo_->setElectronExtraRef(electronExtraProd);
472  }
473 
474 
475  // Save cosmic cleaned muon candidates
476  auto_ptr< reco::PFCandidateCollection >
477  pCosmicsMuonCleanedCandidateCollection( pfAlgo_->transferCosmicsMuonCleanedCandidates() );
478  // Save tracker/global cleaned muon candidates
479  auto_ptr< reco::PFCandidateCollection >
480  pTrackerAndGlobalCleanedMuonCandidateCollection( pfAlgo_->transferCleanedTrackerAndGlobalMuonCandidates() );
481  // Save fake cleaned muon candidates
482  auto_ptr< reco::PFCandidateCollection >
483  pFakeCleanedMuonCandidateCollection( pfAlgo_->transferFakeMuonCleanedCandidates() );
484  // Save punch-through cleaned muon candidates
485  auto_ptr< reco::PFCandidateCollection >
486  pPunchThroughMuonCleanedCandidateCollection( pfAlgo_->transferPunchThroughMuonCleanedCandidates() );
487  // Save punch-through cleaned neutral hadron candidates
488  auto_ptr< reco::PFCandidateCollection >
489  pPunchThroughHadronCleanedCandidateCollection( pfAlgo_->transferPunchThroughHadronCleanedCandidates() );
490  // Save added muon candidates
491  auto_ptr< reco::PFCandidateCollection >
492  pAddedMuonCandidateCollection( pfAlgo_->transferAddedMuonCandidates() );
493 
494  // Check HF overcleaning
496  for ( unsigned ihf=0; ihf<inputTagCleanedHF_.size(); ++ihf ) {
498  bool foundHF = iEvent.getByLabel( inputTagCleanedHF_[ihf], hfCleaned );
499  if (!foundHF) continue;
500  for ( unsigned jhf=0; jhf<(*hfCleaned).size(); ++jhf ) {
501  hfCopy.push_back( (*hfCleaned)[jhf] );
502  }
503  }
504  pfAlgo_->checkCleaning( hfCopy );
505 
506  // Save recovered HF candidates
507  auto_ptr< reco::PFCandidateCollection >
508  pCleanedCandidateCollection( pfAlgo_->transferCleanedCandidates() );
509 
510 
511  // Save the final PFCandidate collection
512  auto_ptr< reco::PFCandidateCollection >
513  pOutputCandidateCollection( pfAlgo_->transferCandidates() );
514 
515 
516 
517  LogDebug("PFProducer")<<"particle flow: putting products in the event"<<endl;
518  if ( verbose_ ) std::cout <<"particle flow: putting products in the event. Here the full list"<<endl;
519  int nC=0;
520  for( reco::PFCandidateCollection::const_iterator itCand = (*pOutputCandidateCollection).begin(); itCand != (*pOutputCandidateCollection).end(); itCand++) {
521  nC++;
522  if (verbose_ ) std::cout << nC << ")" << (*itCand).particleId() << std::endl;
523 
524  }
525 
526  // Write in the event
527  iEvent.put(pOutputCandidateCollection);
528  iEvent.put(pCleanedCandidateCollection,"CleanedHF");
529 
530  if ( postMuonCleaning_ ) {
531  iEvent.put(pCosmicsMuonCleanedCandidateCollection,"CleanedCosmicsMuons");
532  iEvent.put(pTrackerAndGlobalCleanedMuonCandidateCollection,"CleanedTrackerAndGlobalMuons");
533  iEvent.put(pFakeCleanedMuonCandidateCollection,"CleanedFakeMuons");
534  iEvent.put(pPunchThroughMuonCleanedCandidateCollection,"CleanedPunchThroughMuons");
535  iEvent.put(pPunchThroughHadronCleanedCandidateCollection,"CleanedPunchThroughNeutralHadrons");
536  iEvent.put(pAddedMuonCandidateCollection,"AddedMuonsAndHadrons");
537  }
538 
539  if(usePFElectrons_)
540  {
541  auto_ptr< reco::PFCandidateCollection >
542  pOutputElectronCandidateCollection( pfAlgo_->transferElectronCandidates() );
543  iEvent.put(pOutputElectronCandidateCollection,electronOutputCol_);
544 
545  }
546 }
#define LogDebug(id)
RunNumber_t run() const
Definition: EventID.h:42
EventNumber_t event() const
Definition: EventID.h:44
std::auto_ptr< PFAlgo > pfAlgo_
particle flow algorithm
Definition: PFProducer.h:73
edm::InputTag inputTagMuons_
Definition: PFProducer.h:41
std::vector< PFRecHit > PFRecHitCollection
collection of PFRecHit objects
Definition: PFRecHitFwd.h:9
std::vector< edm::InputTag > inputTagCleanedHF_
Definition: PFProducer.h:44
bool useVerticesForNeutral_
Definition: PFProducer.h:64
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:84
edm::InputTag vertices_
Definition: PFProducer.h:42
bool postMuonCleaning_
Definition: PFProducer.h:52
bool isValid() const
Definition: HandleBase.h:76
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:355
edm::InputTag inputTagBlocks_
Definition: PFProducer.h:40
bool usePFElectrons_
Definition: PFProducer.h:55
edm::InputTag inputTagEgammaElectrons_
Definition: PFProducer.h:43
std::string electronOutputCol_
Definition: PFProducer.h:45
bool verbose_
verbose ?
Definition: PFProducer.h:49
std::string electronExtraOutputCol_
Definition: PFProducer.h:46
bool useEGammaElectrons_
Definition: PFProducer.h:61
edm::EventID id() const
Definition: EventBase.h:56
tuple muons
Definition: patZpeak.py:38
tuple cout
Definition: gather_cfg.py:41

Member Data Documentation

std::string PFProducer::electronExtraOutputCol_
private

Definition at line 46 of file PFProducer.h.

std::string PFProducer::electronOutputCol_
private

Definition at line 45 of file PFProducer.h.

edm::InputTag PFProducer::inputTagBlocks_
private

Definition at line 40 of file PFProducer.h.

std::vector<edm::InputTag> PFProducer::inputTagCleanedHF_
private

Definition at line 44 of file PFProducer.h.

edm::InputTag PFProducer::inputTagEgammaElectrons_
private

Definition at line 43 of file PFProducer.h.

edm::InputTag PFProducer::inputTagMuons_
private

Definition at line 41 of file PFProducer.h.

std::auto_ptr<PFAlgo> PFProducer::pfAlgo_
private

particle flow algorithm

Definition at line 73 of file PFProducer.h.

bool PFProducer::postMuonCleaning_
private

Definition at line 52 of file PFProducer.h.

bool PFProducer::useCalibrationsFromDB_
private

Definition at line 67 of file PFProducer.h.

bool PFProducer::useEGammaElectrons_
private

Definition at line 61 of file PFProducer.h.

bool PFProducer::usePFElectrons_
private

Definition at line 55 of file PFProducer.h.

bool PFProducer::usePFPhotons_
private

Definition at line 58 of file PFProducer.h.

bool PFProducer::useVerticesForNeutral_
private

Definition at line 64 of file PFProducer.h.

bool PFProducer::verbose_
private

verbose ?

Definition at line 49 of file PFProducer.h.

edm::InputTag PFProducer::vertices_
private

Definition at line 42 of file PFProducer.h.