CMS 3D CMS Logo

PFBlockProducer Class Reference

Producer for particle flow blocks. More...

#include <RecoParticleFlow/PFBlockProducer/interface/PFBlockProducer.h>

Inheritance diagram for PFBlockProducer:

edm::EDProducer edm::ProducerBase edm::ProductRegistryHelper

List of all members.

Public Member Functions

virtual void beginJob (const edm::EventSetup &c)
 PFBlockProducer (const edm::ParameterSet &)
virtual void produce (edm::Event &, const edm::EventSetup &)
 ~PFBlockProducer ()

Private Attributes

edm::InputTag inputTagGsfRecTracks_
edm::InputTag inputTagPFClustersECAL_
edm::InputTag inputTagPFClustersHCAL_
edm::InputTag inputTagPFClustersPS_
edm::InputTag inputTagPFConversions_
edm::InputTag inputTagPFNuclear_
edm::InputTag inputTagPFV0_
edm::InputTag inputTagRecMuons_
edm::InputTag inputTagRecTracks_
PFBlockAlgo pfBlockAlgo_
 Particle flow block algorithm.
bool useConversions_
 switch on/off Conversions
bool useNuclear_
 use NuclearInteractions ?
bool useV0_
 switch on/off V0
bool verbose_
 verbose ?


Detailed Description

Producer for particle flow blocks.

This producer makes use of PFBlockAlgo, the particle flow block algorithm. Particle flow itself consists in reconstructing particles from the particle flow blocks This is done at a later stage, see PFProducer and PFAlgo.

Author:
Colin Bernet
Date:
April 2007

Definition at line 34 of file PFBlockProducer.h.


Constructor & Destructor Documentation

PFBlockProducer::PFBlockProducer ( const edm::ParameterSet iConfig  )  [explicit]

Definition at line 36 of file PFBlockProducer.cc.

References edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), inputTagGsfRecTracks_, inputTagPFClustersECAL_, inputTagPFClustersHCAL_, inputTagPFClustersPS_, inputTagPFConversions_, inputTagPFNuclear_, inputTagPFV0_, inputTagRecMuons_, inputTagRecTracks_, pfBlockAlgo_, PFBlockAlgo::setDebug(), PFBlockAlgo::setParameters(), useConversions_, useNuclear_, useV0_, and verbose_.

00036                                                                {
00037   
00038 
00039   // use configuration file to setup input/output collection names
00040   inputTagRecTracks_ 
00041     = iConfig.getParameter<InputTag>("RecTracks");
00042 
00043   inputTagGsfRecTracks_ 
00044     = iConfig.getParameter<InputTag>("GsfRecTracks");
00045 
00046   inputTagRecMuons_ 
00047     = iConfig.getParameter<InputTag>("RecMuons");
00048 
00049   inputTagPFNuclear_ 
00050     = iConfig.getParameter<InputTag>("PFNuclear");
00051 
00052   inputTagPFConversions_ 
00053     = iConfig.getParameter<InputTag>("PFConversions");
00054 
00055   inputTagPFV0_ 
00056     = iConfig.getParameter<InputTag>("PFV0");
00057 
00058   inputTagPFClustersECAL_ 
00059     = iConfig.getParameter<InputTag>("PFClustersECAL");
00060 
00061   inputTagPFClustersHCAL_ 
00062     = iConfig.getParameter<InputTag>("PFClustersHCAL");
00063 
00064   inputTagPFClustersPS_ 
00065     = iConfig.getParameter<InputTag>("PFClustersPS");
00066 
00067 
00068 
00069   verbose_ = 
00070     iConfig.getUntrackedParameter<bool>("verbose",false);
00071 
00072   bool debug_ = 
00073     iConfig.getUntrackedParameter<bool>("debug",false);
00074 
00075   useNuclear_ = iConfig.getParameter<bool>("useNuclear");
00076 
00077   useConversions_ = iConfig.getParameter<bool>("useConversions");
00078 
00079   useV0_ = iConfig.getParameter<bool>("useV0");
00080 
00081   produces<reco::PFBlockCollection>();
00082   
00083 
00084   
00085   // particle flow parameters  -----------------------------------
00086 
00087   string map_ECAL_eta 
00088     = iConfig.getParameter<string>("pf_resolution_map_ECAL_eta");  
00089   string map_ECAL_phi 
00090     = iConfig.getParameter<string>("pf_resolution_map_ECAL_phi");  
00091   //   will be necessary when preshower is used:
00092   //   string map_ECALec_x 
00093   //     = iConfig.getParameter<string>("pf_resolution_map_ECALec_x");  
00094   //   string map_ECALec_y 
00095   //     = iConfig.getParameter<string>("pf_resolution_map_ECALec_y");  
00096   string map_HCAL_eta 
00097     = iConfig.getParameter<string>("pf_resolution_map_HCAL_eta");  
00098   string map_HCAL_phi 
00099     = iConfig.getParameter<string>("pf_resolution_map_HCAL_phi"); 
00100         
00101   double DPtovPtCut 
00102      = iConfig.getParameter<double>("pf_DPtoverPt_Cut");   
00103 
00104   double chi2_ECAL_PS 
00105      = iConfig.getParameter<double>("pf_chi2_ECAL_PS");  
00106 //   double chi2_HCAL_PS 
00107 //     = iConfig.getParameter<double>("pf_chi2_HCAL_PS");  
00108 
00109   double chi2_ECAL_Track 
00110     = iConfig.getParameter<double>("pf_chi2_ECAL_Track");  
00111   double chi2_ECAL_GSF 
00112     = iConfig.getParameter<double>("pf_chi2_ECAL_GSF");  
00113   double chi2_HCAL_Track 
00114     = iConfig.getParameter<double>("pf_chi2_HCAL_Track");  
00115   double chi2_ECAL_HCAL 
00116     = iConfig.getParameter<double>("pf_chi2_ECAL_HCAL");  
00117   double chi2_PS_Track 
00118     = iConfig.getParameter<double>("pf_chi2_PS_Track");  
00119   double chi2_PSH_PSV 
00120     = iConfig.getParameter<double>("pf_chi2_PSH_PSV");  
00121   
00122   bool multiLink = 
00123     iConfig.getParameter<bool>("pf_multilink");
00124   
00125   //energyCalibration_ = new PFEnergyCalibration(iConfig);
00126 
00127   
00128   //   PFBlock::setEnergyResolution(energyResolution_);
00129 
00130   edm::FileInPath path_ECAL_eta( map_ECAL_eta.c_str() );
00131   edm::FileInPath path_ECAL_phi( map_ECAL_phi.c_str() );
00132   edm::FileInPath path_HCAL_eta( map_HCAL_eta.c_str() );
00133   edm::FileInPath path_HCAL_phi( map_HCAL_phi.c_str() );
00134    
00135   pfBlockAlgo_.setParameters( path_ECAL_eta.fullPath().c_str(),
00136                               path_ECAL_phi.fullPath().c_str(),
00137                               path_HCAL_eta.fullPath().c_str(),
00138                               path_HCAL_phi.fullPath().c_str(),
00139                               DPtovPtCut,
00140                               chi2_ECAL_Track,
00141                               chi2_ECAL_GSF,
00142                               chi2_HCAL_Track,
00143                               chi2_ECAL_HCAL,
00144                               chi2_ECAL_PS,
00145                               chi2_PS_Track,
00146                               chi2_PSH_PSV,
00147                               multiLink );
00148   
00149   pfBlockAlgo_.setDebug(debug_);
00150 
00151 //   energyCalibration_ = new PFEnergyCalibration();
00152 //   double calibParamECAL_slope_ 
00153 //     = iConfig.getParameter<double>("pf_ECAL_calib_p1");
00154 //   double calibParamECAL_offset_ 
00155 //     = iConfig.getParameter<double>("pf_ECAL_calib_p0");
00156   
00157 //   energyCalibration_->setCalibrationParametersEm(calibParamECAL_slope_, calibParamECAL_offset_); 
00158   
00159 //   //   PFBlock::setEnergyCalibration(energyCalibration_);
00160 //   //energyResolution_ = new PFEnergyResolution(iConfig);
00161 
00162 //   energyResolution_ = new PFEnergyResolution();
00163 
00164 
00165 }

PFBlockProducer::~PFBlockProducer (  ) 

Definition at line 169 of file PFBlockProducer.cc.

00169 { }


Member Function Documentation

void PFBlockProducer::beginJob ( const edm::EventSetup c  )  [virtual]

Reimplemented from edm::EDProducer.

Definition at line 173 of file PFBlockProducer.cc.

00173 { }

void PFBlockProducer::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
) [virtual]

Implements edm::EDProducer.

Definition at line 176 of file PFBlockProducer.cc.

References lat::endl(), edm::EventID::event(), PFBlockAlgo::findBlocks(), edm::Event::getByLabel(), edm::Event::id(), inputTagGsfRecTracks_, inputTagPFClustersECAL_, inputTagPFClustersHCAL_, inputTagPFClustersPS_, inputTagPFConversions_, inputTagPFNuclear_, inputTagPFV0_, inputTagRecMuons_, inputTagRecTracks_, LogDebug, pfBlockAlgo_, pfConversions_cfi::pfConversions, pfV0_cfi::pfV0, edm::Event::put(), edm::EventID::run(), PFBlockAlgo::setInput(), PFBlockAlgo::transferBlocks(), useConversions_, useNuclear_, useV0_, and verbose_.

00177                                                         {
00178   
00179   LogDebug("PFBlockProducer")<<"START event: "<<iEvent.id().event()
00180                              <<" in run "<<iEvent.id().run()<<endl;
00181   
00182   
00183   // get rectracks
00184   
00185   Handle< reco::PFRecTrackCollection > recTracks;
00186   
00187   // LogDebug("PFBlockProducer")<<"get reco tracks"<<endl;
00188   bool found = iEvent.getByLabel(inputTagRecTracks_, recTracks);
00189     
00190   if(!found )
00191     LogError("PFBlockProducer")<<" cannot get rectracks: "
00192                                <<inputTagRecTracks_<<endl;
00193 
00194 
00195 
00196   // get GsfTracks 
00197   Handle< reco::GsfPFRecTrackCollection > GsfrecTracks;
00198   found = iEvent.getByLabel(inputTagGsfRecTracks_,GsfrecTracks);
00199   if(!found )
00200     LogError("PFBlockProducer")<<" cannot get Gsfrectracks: "
00201                                << inputTagGsfRecTracks_ <<endl;
00202  
00203   // get recmuons
00204 
00205   Handle< reco::MuonCollection > recMuons;
00206 
00207   // LogDebug("PFBlockProducer")<<"get reco muons"<<endl;
00208   found = iEvent.getByLabel(inputTagRecMuons_, recMuons);
00209   
00210   //if(!found )
00211   //  LogError("PFBlockProducer")<<" cannot get recmuons: "
00212   //                           <<inputTagRecMuons_<<endl;
00213 
00214 
00215   // get PFNuclearInteractions
00216 
00217   Handle< reco::PFNuclearInteractionCollection > pfNuclears;
00218   if( useNuclear_ ) {
00219     found = iEvent.getByLabel(inputTagPFNuclear_, pfNuclears);
00220 
00221 
00222     if(!found )
00223       LogError("PFBlockProducer")<<" cannot get PFNuclearInteractions : "
00224                                <<inputTagPFNuclear_<<endl;
00225   }
00226 
00227 
00228 
00229  
00230   // get conversions
00231   Handle< reco::PFConversionCollection > pfConversions;
00232   if( useConversions_ ) {
00233     found = iEvent.getByLabel(inputTagPFConversions_, pfConversions);
00234     
00235     if(!found )
00236       LogError("PFBlockProducer")<<" cannot get PFConversions : "
00237                                  <<inputTagPFConversions_<<endl;
00238   }
00239   
00240 
00241   // get V0s
00242   Handle< reco::PFV0Collection > pfV0;
00243   if( useV0_ ) {
00244     found = iEvent.getByLabel(inputTagPFV0_, pfV0);
00245     
00246     if(!found )
00247       LogError("PFBlockProducer")<<" cannot get PFV0 : "
00248                                  <<inputTagPFV0_<<endl;
00249   }
00250 
00251 
00252   
00253   // get ECAL, HCAL and PS clusters
00254   
00255   
00256   Handle< reco::PFClusterCollection > clustersECAL;
00257   found = iEvent.getByLabel(inputTagPFClustersECAL_, 
00258                             clustersECAL);      
00259   if(!found )
00260     LogError("PFBlockProducer")<<" cannot get ECAL clusters: "
00261                                <<inputTagPFClustersECAL_<<endl;
00262     
00263   
00264   Handle< reco::PFClusterCollection > clustersHCAL;
00265   found = iEvent.getByLabel(inputTagPFClustersHCAL_, 
00266                             clustersHCAL);      
00267   if(!found )
00268     LogError("PFBlockProducer")<<" cannot get HCAL clusters: "
00269                                <<inputTagPFClustersHCAL_<<endl;
00270     
00271 
00272   Handle< reco::PFClusterCollection > clustersPS;
00273   found = iEvent.getByLabel(inputTagPFClustersPS_, 
00274                             clustersPS);      
00275   if(!found )
00276     LogError("PFBlockProducer")<<" cannot get PS clusters: "
00277                                <<inputTagPFClustersPS_<<endl;
00278     
00279   
00280 
00281   
00282   
00283   pfBlockAlgo_.setInput( recTracks, 
00284                          GsfrecTracks,
00285                          recMuons, 
00286                          pfNuclears,
00287                          pfConversions,
00288                          pfV0,
00289                          clustersECAL,
00290                          clustersHCAL,
00291                          clustersPS );
00292   pfBlockAlgo_.findBlocks();
00293   
00294   if(verbose_) {
00295     ostringstream  str;
00296     str<<pfBlockAlgo_<<endl;
00297     LogInfo("PFBlockProducer") << str.str()<<endl;
00298   }    
00299   
00300   auto_ptr< reco::PFBlockCollection > 
00301     pOutputBlockCollection( pfBlockAlgo_.transferBlocks() ); 
00302   
00303   
00304   iEvent.put(pOutputBlockCollection);
00305   
00306   LogDebug("PFBlockProducer")<<"STOP event: "<<iEvent.id().event()
00307                              <<" in run "<<iEvent.id().run()<<endl;
00308 }


Member Data Documentation

edm::InputTag PFBlockProducer::inputTagGsfRecTracks_ [private]

Definition at line 50 of file PFBlockProducer.h.

Referenced by PFBlockProducer(), and produce().

edm::InputTag PFBlockProducer::inputTagPFClustersECAL_ [private]

Definition at line 53 of file PFBlockProducer.h.

Referenced by PFBlockProducer(), and produce().

edm::InputTag PFBlockProducer::inputTagPFClustersHCAL_ [private]

Definition at line 54 of file PFBlockProducer.h.

Referenced by PFBlockProducer(), and produce().

edm::InputTag PFBlockProducer::inputTagPFClustersPS_ [private]

Definition at line 55 of file PFBlockProducer.h.

Referenced by PFBlockProducer(), and produce().

edm::InputTag PFBlockProducer::inputTagPFConversions_ [private]

Definition at line 56 of file PFBlockProducer.h.

Referenced by PFBlockProducer(), and produce().

edm::InputTag PFBlockProducer::inputTagPFNuclear_ [private]

Definition at line 52 of file PFBlockProducer.h.

Referenced by PFBlockProducer(), and produce().

edm::InputTag PFBlockProducer::inputTagPFV0_ [private]

Definition at line 57 of file PFBlockProducer.h.

Referenced by PFBlockProducer(), and produce().

edm::InputTag PFBlockProducer::inputTagRecMuons_ [private]

Definition at line 51 of file PFBlockProducer.h.

Referenced by PFBlockProducer(), and produce().

edm::InputTag PFBlockProducer::inputTagRecTracks_ [private]

Definition at line 49 of file PFBlockProducer.h.

Referenced by PFBlockProducer(), and produce().

PFBlockAlgo PFBlockProducer::pfBlockAlgo_ [private]

Particle flow block algorithm.

Definition at line 73 of file PFBlockProducer.h.

Referenced by PFBlockProducer(), and produce().

bool PFBlockProducer::useConversions_ [private]

switch on/off Conversions

Definition at line 67 of file PFBlockProducer.h.

Referenced by PFBlockProducer(), and produce().

bool PFBlockProducer::useNuclear_ [private]

use NuclearInteractions ?

Definition at line 63 of file PFBlockProducer.h.

Referenced by PFBlockProducer(), and produce().

bool PFBlockProducer::useV0_ [private]

switch on/off V0

Definition at line 70 of file PFBlockProducer.h.

Referenced by PFBlockProducer(), and produce().

bool PFBlockProducer::verbose_ [private]

verbose ?

Definition at line 60 of file PFBlockProducer.h.

Referenced by PFBlockProducer(), and produce().


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:29:40 2009 for CMSSW by  doxygen 1.5.4