CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_4_1_8_patch13/src/RecoParticleFlow/PFProducer/plugins/PFProducer.cc

Go to the documentation of this file.
00001 #include "RecoParticleFlow/PFProducer/plugins/PFProducer.h"
00002 #include "RecoParticleFlow/PFProducer/interface/PFAlgo.h"
00003 #include "FWCore/MessageLogger/interface/MessageLogger.h"
00004 #include "RecoParticleFlow/PFClusterTools/interface/PFEnergyCalibration.h"
00005 #include "RecoParticleFlow/PFClusterTools/interface/PFClusterCalibration.h"
00006 #include "RecoParticleFlow/PFClusterTools/interface/PFEnergyCalibrationHF.h"
00007 #include "RecoParticleFlow/PFClusterTools/interface/PFSCEnergyCalibration.h"
00008 #include "DataFormats/EgammaCandidates/interface/GsfElectronFwd.h"
00009 #include "DataFormats/EgammaCandidates/interface/GsfElectron.h"
00010 #include "DataFormats/ParticleFlowReco/interface/PFRecHitFwd.h"
00011 #include "DataFormats/ParticleFlowReco/interface/PFRecHit.h"
00012 #include <sstream>
00013 
00014 using namespace std;
00015 
00016 using namespace boost;
00017 
00018 using namespace edm;
00019 
00020 
00021 
00022 PFProducer::PFProducer(const edm::ParameterSet& iConfig) {
00023   
00024   unsigned int newCalib = 
00025     iConfig.getParameter<unsigned int>("pf_newCalib");
00026 
00027   // Create a PFClusterCalbration auto_ptr
00028   boost::shared_ptr<pftools::PFClusterCalibration> 
00029     clusterCalibration( new pftools::PFClusterCalibration() );
00030 
00031   // Initialise function parameters properly.
00032   double lowEP0 
00033     = iConfig.getParameter<double>("pfcluster_lowEP0");
00034   double lowEP1 
00035     = iConfig.getParameter<double>("pfcluster_lowEP1");
00036   double globalP0 
00037     = iConfig.getParameter<double>("pfcluster_globalP0");
00038   double globalP1 
00039     = iConfig.getParameter<double>("pfcluster_globalP1");
00040   // 
00041   clusterCalibration->setCorrections(lowEP0, lowEP1, globalP0, globalP1);
00042  
00043   unsigned int allowNegative    
00044         = iConfig.getParameter<unsigned int>("pfcluster_allowNegative");
00045   clusterCalibration->setAllowNegativeEnergy(allowNegative);
00046         
00047   unsigned int doCorrection
00048     = iConfig.getParameter<unsigned int>("pfcluster_doCorrection");
00049   clusterCalibration->setDoCorrection(doCorrection);
00050  
00051   double barrelEta
00052     = iConfig.getParameter<double>("pfcluster_barrelEndcapEtaDiv");
00053   clusterCalibration->setBarrelBoundary(barrelEta);
00054         
00055   /* Now obsolete 
00056   double ecalEcut = 
00057     iConfig.getParameter<double>("pfcluster_ecalECut");
00058   double hcalEcut = 
00059     iConfig.getParameter<double>("pfcluster_hcalECut");
00060 
00061   clusterCalibration->setEcalHcalEnergyCuts(ecalEcut,hcalEcut);
00062   */
00063  
00064   std::vector<std::string>* names = clusterCalibration->getKnownSectorNames();
00065   for(std::vector<std::string>::iterator i = names->begin(); i != names->end(); ++i) {
00066     std::string sector = *i;
00067     std::vector<double> params
00068     = iConfig.getParameter<std::vector<double> >(sector);
00069     clusterCalibration->setEvolutionParameters(sector, params);
00070   }
00071 
00072   //Finally set eta correction
00073   unsigned int doEtaCorrection = iConfig.getParameter<unsigned int>("pfcluster_doEtaCorrection");   
00074   clusterCalibration->setDoEtaCorrection(doEtaCorrection);
00075 
00076   std::vector<double> etaCorrectionParams = 
00077     iConfig.getParameter<std::vector<double> >("pfcluster_etaCorrection");
00078   clusterCalibration->setEtaCorrectionParameters(etaCorrectionParams);
00079   // use configuration file to setup input/output collection names
00080   //std::cout << "Finished initialisaing PFClusterCalibration: it looks like...\n";
00081   //std::cout  << *clusterCalibration << std::endl;
00082 
00083   //Done with PFClusterCalibration //
00084 
00085   //--ab: get calibration factors for HF:
00086   bool calibHF_use;
00087   std::vector<double>  calibHF_eta_step;
00088   std::vector<double>  calibHF_a_EMonly;
00089   std::vector<double>  calibHF_b_HADonly;
00090   std::vector<double>  calibHF_a_EMHAD;
00091   std::vector<double>  calibHF_b_EMHAD;
00092   calibHF_use =     iConfig.getParameter<bool>("calibHF_use");
00093   calibHF_eta_step  = iConfig.getParameter<std::vector<double> >("calibHF_eta_step");
00094   calibHF_a_EMonly  = iConfig.getParameter<std::vector<double> >("calibHF_a_EMonly");
00095   calibHF_b_HADonly = iConfig.getParameter<std::vector<double> >("calibHF_b_HADonly");
00096   calibHF_a_EMHAD   = iConfig.getParameter<std::vector<double> >("calibHF_a_EMHAD");
00097   calibHF_b_EMHAD   = iConfig.getParameter<std::vector<double> >("calibHF_b_EMHAD");
00098   boost::shared_ptr<PFEnergyCalibrationHF>  
00099     thepfEnergyCalibrationHF ( new PFEnergyCalibrationHF(calibHF_use,calibHF_eta_step,calibHF_a_EMonly,calibHF_b_HADonly,calibHF_a_EMHAD,calibHF_b_EMHAD) ) ;
00100   //-----------------
00101 
00102   inputTagBlocks_ 
00103     = iConfig.getParameter<InputTag>("blocks");
00104 
00105   //Post cleaning of the muons
00106   inputTagMuons_ 
00107     = iConfig.getParameter<InputTag>("muons");
00108   postMuonCleaning_
00109     = iConfig.getParameter<bool>("postMuonCleaning");
00110 
00111   usePFElectrons_
00112     = iConfig.getParameter<bool>("usePFElectrons");    
00113 
00114   useEGammaElectrons_
00115     = iConfig.getParameter<bool>("useEGammaElectrons");    
00116 
00117   if(  useEGammaElectrons_) {
00118     inputTagEgammaElectrons_ = iConfig.getParameter<edm::InputTag>("egammaElectrons");
00119   }
00120 
00121   electronOutputCol_
00122     = iConfig.getParameter<std::string>("pf_electron_output_col");
00123 
00124   bool usePFSCEleCalib;
00125   std::vector<double>  calibPFSCEle_barrel;
00126   std::vector<double>  calibPFSCEle_endcap;
00127   usePFSCEleCalib =     iConfig.getParameter<bool>("usePFSCEleCalib");
00128   calibPFSCEle_barrel = iConfig.getParameter<std::vector<double> >("calibPFSCEle_barrel");
00129   calibPFSCEle_endcap = iConfig.getParameter<std::vector<double> >("calibPFSCEle_endcap");
00130   boost::shared_ptr<PFSCEnergyCalibration>  
00131     thePFSCEnergyCalibration ( new PFSCEnergyCalibration(calibPFSCEle_barrel,calibPFSCEle_endcap ));
00132                                
00133   bool useEGammaSupercluster = iConfig.getParameter<bool>("useEGammaSupercluster");
00134   double sumEtEcalIsoForEgammaSC_barrel = iConfig.getParameter<double>("sumEtEcalIsoForEgammaSC_barrel");
00135   double sumEtEcalIsoForEgammaSC_endcap = iConfig.getParameter<double>("sumEtEcalIsoForEgammaSC_endcap");
00136   double coneEcalIsoForEgammaSC = iConfig.getParameter<double>("coneEcalIsoForEgammaSC");
00137   double sumPtTrackIsoForEgammaSC_barrel = iConfig.getParameter<double>("sumPtTrackIsoForEgammaSC_barrel");
00138   double sumPtTrackIsoForEgammaSC_endcap = iConfig.getParameter<double>("sumPtTrackIsoForEgammaSC_endcap");
00139   double coneTrackIsoForEgammaSC = iConfig.getParameter<double>("coneTrackIsoForEgammaSC");
00140   unsigned int nTrackIsoForEgammaSC  = iConfig.getParameter<unsigned int>("nTrackIsoForEgammaSC");
00141 
00142 
00143   // register products
00144   produces<reco::PFCandidateCollection>();
00145   produces<reco::PFCandidateCollection>("CleanedHF");
00146   produces<reco::PFCandidateCollection>("CleanedCosmicsMuons");
00147   produces<reco::PFCandidateCollection>("CleanedTrackerAndGlobalMuons");
00148   produces<reco::PFCandidateCollection>("CleanedFakeMuons");
00149   produces<reco::PFCandidateCollection>("CleanedPunchThroughMuons");
00150   produces<reco::PFCandidateCollection>("CleanedPunchThroughNeutralHadrons");
00151   produces<reco::PFCandidateCollection>("AddedMuonsAndHadrons");
00152 
00153 
00154   if (usePFElectrons_) {
00155     produces<reco::PFCandidateCollection>(electronOutputCol_);
00156     produces<reco::PFCandidateElectronExtraCollection>(electronExtraOutputCol_);
00157   }
00158 
00159   double nSigmaECAL 
00160     = iConfig.getParameter<double>("pf_nsigma_ECAL");
00161   double nSigmaHCAL 
00162     = iConfig.getParameter<double>("pf_nsigma_HCAL");
00163   
00164   
00165   double e_slope
00166     = iConfig.getParameter<double>("pf_calib_ECAL_slope");
00167   double e_offset 
00168     = iConfig.getParameter<double>("pf_calib_ECAL_offset");
00169   
00170   double eh_eslope
00171     = iConfig.getParameter<double>("pf_calib_ECAL_HCAL_eslope");
00172   double eh_hslope 
00173     = iConfig.getParameter<double>("pf_calib_ECAL_HCAL_hslope");
00174   double eh_offset 
00175     = iConfig.getParameter<double>("pf_calib_ECAL_HCAL_offset");
00176   
00177   double h_slope
00178     = iConfig.getParameter<double>("pf_calib_HCAL_slope");
00179   double h_offset 
00180     = iConfig.getParameter<double>("pf_calib_HCAL_offset");
00181   double h_damping 
00182     = iConfig.getParameter<double>("pf_calib_HCAL_damping");
00183 
00184   //PFElectrons Configuration
00185   double mvaEleCut
00186     = iConfig.getParameter<double>("pf_electron_mvaCut");
00187 
00188   string mvaWeightFileEleID
00189     = iConfig.getParameter<string>("pf_electronID_mvaWeightFile");
00190 
00191   bool applyCrackCorrectionsForElectrons
00192     = iConfig.getParameter<bool>("pf_electronID_crackCorrection");
00193 
00194   string path_mvaWeightFileEleID;
00195   if(usePFElectrons_)
00196     {
00197       path_mvaWeightFileEleID = edm::FileInPath ( mvaWeightFileEleID.c_str() ).fullPath();
00198     }
00199 
00200 
00201   //Secondary tracks and displaced vertices parameters
00202 
00203   bool rejectTracks_Bad
00204     = iConfig.getParameter<bool>("rejectTracks_Bad");
00205 
00206   bool rejectTracks_Step45
00207     = iConfig.getParameter<bool>("rejectTracks_Step45");
00208 
00209   bool usePFNuclearInteractions
00210     = iConfig.getParameter<bool>("usePFNuclearInteractions");
00211 
00212   bool usePFConversions
00213     = iConfig.getParameter<bool>("usePFConversions");  
00214 
00215   bool usePFDecays
00216     = iConfig.getParameter<bool>("usePFDecays");
00217 
00218   double dptRel_DispVtx
00219     = iConfig.getParameter<double>("dptRel_DispVtx");
00220 
00221   edm::ParameterSet iCfgCandConnector 
00222     = iConfig.getParameter<edm::ParameterSet>("iCfgCandConnector");
00223 
00224 
00225   boost::shared_ptr<PFEnergyCalibration> 
00226     calibration( new PFEnergyCalibration( e_slope,
00227                                           e_offset, 
00228                                           eh_eslope,
00229                                           eh_hslope,
00230                                           eh_offset,
00231                                           h_slope,
00232                                           h_offset,
00233                                           h_damping,
00234                                           newCalib ) );
00235 
00236   int algoType 
00237     = iConfig.getParameter<unsigned>("algoType");
00238   
00239   switch(algoType) {
00240   case 0:
00241     pfAlgo_.reset( new PFAlgo);
00242     break;
00243    default:
00244     assert(0);
00245   }
00246   
00247   pfAlgo_->setParameters( nSigmaECAL, 
00248                           nSigmaHCAL,
00249                           calibration,
00250                           clusterCalibration,
00251                           thepfEnergyCalibrationHF,
00252                           newCalib);
00253 
00254   //PFElectrons: call the method setpfeleparameters
00255   pfAlgo_->setPFEleParameters(mvaEleCut,
00256                               path_mvaWeightFileEleID,
00257                               usePFElectrons_,
00258                               thePFSCEnergyCalibration,
00259                               sumEtEcalIsoForEgammaSC_barrel,
00260                               sumEtEcalIsoForEgammaSC_endcap,
00261                               coneEcalIsoForEgammaSC,
00262                               sumPtTrackIsoForEgammaSC_barrel,
00263                               sumPtTrackIsoForEgammaSC_endcap,
00264                               nTrackIsoForEgammaSC,
00265                               coneTrackIsoForEgammaSC,
00266                               applyCrackCorrectionsForElectrons,
00267                               usePFSCEleCalib,
00268                               useEGammaElectrons_,
00269                               useEGammaSupercluster);
00270   
00271   //  pfAlgo_->setPFConversionParameters(usePFConversions);
00272   
00273   //Secondary tracks and displaced vertices parameters
00274   
00275   pfAlgo_->setDisplacedVerticesParameters(rejectTracks_Bad,
00276                                           rejectTracks_Step45,
00277                                           usePFNuclearInteractions,
00278                                           usePFConversions,
00279                                           usePFDecays,
00280                                           dptRel_DispVtx);
00281   
00282 
00283 
00284 
00285 
00286   if (usePFNuclearInteractions)
00287     pfAlgo_->setCandConnectorParameters( iCfgCandConnector );
00288 
00289   // Muon parameters
00290   std::vector<double> muonHCAL
00291     = iConfig.getParameter<std::vector<double> >("muon_HCAL");  
00292   std::vector<double> muonECAL
00293     = iConfig.getParameter<std::vector<double> >("muon_ECAL");  
00294   assert ( muonHCAL.size() == 2 && muonECAL.size() == 2 );
00295   
00296   // Fake track parameters
00297   double nSigmaTRACK
00298     = iConfig.getParameter<double>("nsigma_TRACK");  
00299   
00300   double ptError
00301     = iConfig.getParameter<double>("pt_Error");  
00302   
00303   std::vector<double> factors45
00304     = iConfig.getParameter<std::vector<double> >("factors_45");  
00305   assert ( factors45.size() == 2 );
00306   
00307   bool usePFMuonMomAssign
00308     = iConfig.getParameter<bool>("usePFMuonMomAssign");
00309 
00310   // Set muon and fake track parameters
00311   pfAlgo_->setPFMuonAndFakeParameters(muonHCAL,
00312                                       muonECAL,
00313                                       nSigmaTRACK,
00314                                       ptError,
00315                                       factors45,
00316                                       usePFMuonMomAssign);
00317   
00318   //Post cleaning of the HF
00319   bool postHFCleaning
00320     = iConfig.getParameter<bool>("postHFCleaning");
00321 
00322   double minHFCleaningPt 
00323     = iConfig.getParameter<double>("minHFCleaningPt");
00324   double minSignificance
00325     = iConfig.getParameter<double>("minSignificance");
00326   double maxSignificance
00327     = iConfig.getParameter<double>("maxSignificance");
00328   double minSignificanceReduction
00329     = iConfig.getParameter<double>("minSignificanceReduction");
00330   double maxDeltaPhiPt
00331     = iConfig.getParameter<double>("maxDeltaPhiPt");
00332   double minDeltaMet
00333     = iConfig.getParameter<double>("minDeltaMet");
00334 
00335   // Set post HF cleaning muon parameters
00336   pfAlgo_->setPostHFCleaningParameters(postHFCleaning,
00337                                        minHFCleaningPt,
00338                                        minSignificance,
00339                                        maxSignificance,
00340                                        minSignificanceReduction,
00341                                        maxDeltaPhiPt,
00342                                        minDeltaMet);
00343 
00344   // Input tags for HF cleaned rechits
00345   inputTagCleanedHF_ 
00346     = iConfig.getParameter< std::vector<edm::InputTag> >("cleanedHF");
00347 
00348   //MIKE: Vertex Parameters
00349   vertices_ = iConfig.getParameter<edm::InputTag>("vertexCollection");
00350   useVerticesForNeutral_ = iConfig.getParameter<bool>("useVerticesForNeutral");
00351 
00352 
00353 
00354   verbose_ = 
00355     iConfig.getUntrackedParameter<bool>("verbose",false);
00356 
00357   bool debug_ = 
00358     iConfig.getUntrackedParameter<bool>("debug",false);
00359 
00360   pfAlgo_->setDebug( debug_ );
00361 
00362 }
00363 
00364 
00365 
00366 PFProducer::~PFProducer() {}
00367 
00368 
00369 void 
00370 PFProducer::beginJob() {}
00371 
00372 void 
00373 PFProducer::beginRun(edm::Run & run, 
00374                      const edm::EventSetup & es) {}
00375 
00376 
00377 void 
00378 PFProducer::produce(Event& iEvent, 
00379                     const EventSetup& iSetup) {
00380   
00381   LogDebug("PFProducer")<<"START event: "
00382                         <<iEvent.id().event()
00383                         <<" in run "<<iEvent.id().run()<<endl;
00384   
00385 
00386   // Get The vertices from the event
00387   // and assign dynamic vertex parameters
00388   edm::Handle<reco::VertexCollection> vertices;
00389   bool gotVertices = iEvent.getByLabel(vertices_,vertices);
00390   if(!gotVertices) {
00391     ostringstream err;
00392     err<<"Cannot find vertices for this event.Continuing Without them ";
00393     LogError("PFProducer")<<err.str()<<endl;
00394   }
00395 
00396   //Assign the PFAlgo Parameters
00397   pfAlgo_->setPFVertexParameters(useVerticesForNeutral_,*vertices);
00398 
00399   // get the collection of blocks 
00400 
00401   Handle< reco::PFBlockCollection > blocks;
00402 
00403   LogDebug("PFProducer")<<"getting blocks"<<endl;
00404   bool found = iEvent.getByLabel( inputTagBlocks_, blocks );  
00405 
00406   if(!found ) {
00407 
00408     ostringstream err;
00409     err<<"cannot find blocks: "<<inputTagBlocks_;
00410     LogError("PFProducer")<<err.str()<<endl;
00411     
00412     throw cms::Exception( "MissingProduct", err.str());
00413   }
00414 
00415   // get the collection of muons 
00416 
00417   Handle< reco::MuonCollection > muons;
00418 
00419   if ( postMuonCleaning_ ) {
00420 
00421     LogDebug("PFProducer")<<"getting muons"<<endl;
00422     found = iEvent.getByLabel( inputTagMuons_, muons );  
00423 
00424     if(!found) {
00425       ostringstream err;
00426       err<<"cannot find muons: "<<inputTagMuons_;
00427       LogError("PFProducer")<<err.str()<<endl;
00428     
00429       throw cms::Exception( "MissingProduct", err.str());
00430     }
00431 
00432   }
00433 
00434   if (useEGammaElectrons_) {
00435     Handle < reco::GsfElectronCollection > egelectrons;
00436     
00437     LogDebug("PFProducer")<<" Reading e/gamma electrons activated "<<endl;
00438     found = iEvent.getByLabel( inputTagEgammaElectrons_, egelectrons );  
00439     
00440     if(!found) {
00441       ostringstream err;
00442       err<<"cannot find electrons: "<<inputTagEgammaElectrons_;
00443       LogError("PFProducer")<<err.str()<<endl;
00444     
00445       throw cms::Exception( "MissingProduct", err.str());
00446     }
00447     
00448     pfAlgo_->setEGElectronCollection(*egelectrons);
00449   }
00450 
00451   
00452   LogDebug("PFProducer")<<"particle flow is starting"<<endl;
00453 
00454   assert( blocks.isValid() );
00455  
00456   pfAlgo_->reconstructParticles( blocks );
00457 
00458   if(verbose_) {
00459     ostringstream  str;
00460     str<<(*pfAlgo_)<<endl;
00461     //    cout << (*pfAlgo_) << endl;
00462     LogInfo("PFProducer") <<str.str()<<endl;
00463   }  
00464 
00465 
00466   if ( postMuonCleaning_ )
00467     pfAlgo_->postMuonCleaning( muons, *vertices );
00468 
00469   // Florian 5/01/2011
00470   // Save the PFElectron Extra Collection First as to be able to create valid References  
00471   if(usePFElectrons_)   {  
00472     auto_ptr< reco::PFCandidateElectronExtraCollection >
00473       pOutputElectronCandidateExtraCollection( pfAlgo_->transferElectronExtra() ); 
00474 
00475     const edm::OrphanHandle<reco::PFCandidateElectronExtraCollection > electronExtraProd=
00476       iEvent.put(pOutputElectronCandidateExtraCollection,electronExtraOutputCol_);      
00477     pfAlgo_->setElectronExtraRef(electronExtraProd);
00478   }
00479 
00480 
00481   // Save cosmic cleaned muon candidates
00482   auto_ptr< reco::PFCandidateCollection > 
00483     pCosmicsMuonCleanedCandidateCollection( pfAlgo_->transferCosmicsMuonCleanedCandidates() ); 
00484   // Save tracker/global cleaned muon candidates
00485   auto_ptr< reco::PFCandidateCollection > 
00486     pTrackerAndGlobalCleanedMuonCandidateCollection( pfAlgo_->transferCleanedTrackerAndGlobalMuonCandidates() ); 
00487   // Save fake cleaned muon candidates
00488   auto_ptr< reco::PFCandidateCollection > 
00489     pFakeCleanedMuonCandidateCollection( pfAlgo_->transferFakeMuonCleanedCandidates() ); 
00490   // Save punch-through cleaned muon candidates
00491   auto_ptr< reco::PFCandidateCollection > 
00492     pPunchThroughMuonCleanedCandidateCollection( pfAlgo_->transferPunchThroughMuonCleanedCandidates() ); 
00493   // Save punch-through cleaned neutral hadron candidates
00494   auto_ptr< reco::PFCandidateCollection > 
00495     pPunchThroughHadronCleanedCandidateCollection( pfAlgo_->transferPunchThroughHadronCleanedCandidates() ); 
00496   // Save added muon candidates
00497   auto_ptr< reco::PFCandidateCollection > 
00498     pAddedMuonCandidateCollection( pfAlgo_->transferAddedMuonCandidates() ); 
00499 
00500   // Check HF overcleaning
00501   reco::PFRecHitCollection hfCopy;
00502   for ( unsigned ihf=0; ihf<inputTagCleanedHF_.size(); ++ihf ) {
00503     Handle< reco::PFRecHitCollection > hfCleaned;
00504     bool foundHF = iEvent.getByLabel( inputTagCleanedHF_[ihf], hfCleaned );  
00505     if (!foundHF) continue;
00506     for ( unsigned jhf=0; jhf<(*hfCleaned).size(); ++jhf ) { 
00507       hfCopy.push_back( (*hfCleaned)[jhf] );
00508     }
00509   }
00510   pfAlgo_->checkCleaning( hfCopy );
00511 
00512   // Save recovered HF candidates
00513   auto_ptr< reco::PFCandidateCollection > 
00514     pCleanedCandidateCollection( pfAlgo_->transferCleanedCandidates() ); 
00515 
00516   
00517   // Save the final PFCandidate collection
00518   auto_ptr< reco::PFCandidateCollection > 
00519     pOutputCandidateCollection( pfAlgo_->transferCandidates() ); 
00520   
00521 
00522   
00523   LogDebug("PFProducer")<<"particle flow: putting products in the event"<<endl;
00524   if ( verbose_ ) std::cout <<"particle flow: putting products in the event. Here the full list"<<endl;
00525   int nC=0;
00526   for( reco::PFCandidateCollection::const_iterator  itCand =  (*pOutputCandidateCollection).begin(); itCand !=  (*pOutputCandidateCollection).end(); itCand++) {
00527     nC++;
00528       if (verbose_ ) std::cout << nC << ")" << (*itCand).particleId() << std::endl;
00529 
00530   }
00531 
00532   // Write in the event
00533   iEvent.put(pOutputCandidateCollection);
00534   iEvent.put(pCleanedCandidateCollection,"CleanedHF");
00535 
00536   if ( postMuonCleaning_ ) { 
00537     iEvent.put(pCosmicsMuonCleanedCandidateCollection,"CleanedCosmicsMuons");
00538     iEvent.put(pTrackerAndGlobalCleanedMuonCandidateCollection,"CleanedTrackerAndGlobalMuons");
00539     iEvent.put(pFakeCleanedMuonCandidateCollection,"CleanedFakeMuons");
00540     iEvent.put(pPunchThroughMuonCleanedCandidateCollection,"CleanedPunchThroughMuons");
00541     iEvent.put(pPunchThroughHadronCleanedCandidateCollection,"CleanedPunchThroughNeutralHadrons");
00542     iEvent.put(pAddedMuonCandidateCollection,"AddedMuonsAndHadrons");
00543   }
00544 
00545   if(usePFElectrons_)
00546     {
00547       auto_ptr< reco::PFCandidateCollection >  
00548         pOutputElectronCandidateCollection( pfAlgo_->transferElectronCandidates() ); 
00549       iEvent.put(pOutputElectronCandidateCollection,electronOutputCol_);
00550 
00551     }
00552 }
00553