CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
PFAlgo.h
Go to the documentation of this file.
1 #ifndef RecoParticleFlow_PFProducer_PFAlgo_h
2 #define RecoParticleFlow_PFProducer_PFAlgo_h
3 
4 #include <iostream>
5 
6 
7 // #include "FWCore/Framework/interface/Handle.h"
9 // #include "FWCore/Framework/interface/OrphanHandle.h"
11 
15 
16 // next include is necessary for inline functions.
18 
23 
31 
33 
42 class PFElectronAlgo;
43 class PFConversionAlgo;
44 
45 namespace pftools {
46  class PFClusterCalibration;
47 }
48 
49 class PFAlgo {
50 
51  public:
52 
54  PFAlgo();
55 
57  virtual ~PFAlgo();
58 
59  void setAlgo( int algo ) {algo_ = algo;}
60 
62 
63  void setParameters(double nSigmaECAL,
64  double nSigmaHCAL,
65  const boost::shared_ptr<PFEnergyCalibration>& calibration,
66  const boost::shared_ptr<pftools::PFClusterCalibration>& clusterCalibration,
67  const boost::shared_ptr<PFEnergyCalibrationHF>& thepfEnergyCalibrationHF,
68  unsigned int newCalib);
69 
71  connector_.setParameters(iCfgCandConnector);
72  }
73 
74  void setCandConnectorParameters(bool bCorrect,
75  bool bCalibPrimary,
76  double dptRel_PrimaryTrack,
77  double dptRel_MergedTrack,
78  double ptErrorSecondary,
79  std::vector<double> nuclCalibFactors){
80  connector_.setParameters(bCorrect, bCalibPrimary, dptRel_PrimaryTrack, dptRel_MergedTrack, ptErrorSecondary, nuclCalibFactors);
81  }
82 
83 
84  void setPFMuonAndFakeParameters(std::vector<double> muonHCAL,
85  std::vector<double> muonECAL,
86  double nSigmaTRACK,
87  double ptError,
88  std::vector<double> factors45,
89  bool usePFMuonMomAssign);
90 
91  void setPFEleParameters(double mvaEleCut,
92  std::string mvaWeightFileEleID,
93  bool usePFElectrons,
94  const boost::shared_ptr<PFSCEnergyCalibration>& thePFSCEnergyCalibration,
100  unsigned int nTrackIsoForEgammaSC,
102  bool applyCrackCorrections=false,
103  bool usePFSCEleCalib=true,
104  bool useEGElectrons=false,
105  bool useEGammaSupercluster = true);
106 
108  double minHFCleaningPt,
109  double minSignificance,
110  double maxSignificance,
112  double maxDeltaPhiPt,
113  double minDeltaMet);
114 
116  bool rejectTracks_Step45,
118  bool usePFConversions,
119  bool usePFDecays,
120  double dptRel_DispVtx);
121 
122  //MIKEB : Parameters for the vertices..
123  void setPFVertexParameters(bool useVertex,
124  const reco::VertexCollection& primaryVertices);
125 
126  // FlorianB : Collection of e/g electrons
127  void setEGElectronCollection(const reco::GsfElectronCollection & egelectrons);
128 
132  void reconstructParticles( const reco::PFBlockHandle& blockHandle );
133 
135  virtual void reconstructParticles( const reco::PFBlockCollection& blocks );
136 
139 
140  // Post Muon Cleaning
142  const reco::VertexCollection& primaryVertices );
143 
144  // Post Electron Extra Ref
146 
148  const std::auto_ptr< reco::PFCandidateCollection >& pfCandidates() const {
149  return pfCandidates_;
150  }
151 
153  std::auto_ptr< reco::PFCandidateCollection> transferElectronCandidates() {
154  return pfElectronCandidates_;
155  }
156 
158  // done this way because the pfElectronExtra is needed later in the code to create the Refs and with an auto_ptr, it would be destroyed
159  std::auto_ptr< reco::PFCandidateElectronExtraCollection> transferElectronExtra() {
160  std::auto_ptr< reco::PFCandidateElectronExtraCollection> result(new reco::PFCandidateElectronExtraCollection);
161  result->insert(result->end(),pfElectronExtra_.begin(),pfElectronExtra_.end());
162  return result;
163  }
164 
165 
167  std::auto_ptr< reco::PFCandidateCollection >& transferCleanedCandidates() {
168  return pfCleanedCandidates_;
169  }
170 
172  std::auto_ptr< reco::PFCandidateCollection > transferCosmicsMuonCleanedCandidates() {
174  }
175 
177  std::auto_ptr< reco::PFCandidateCollection > transferCleanedTrackerAndGlobalMuonCandidates() {
179  }
180 
182  std::auto_ptr< reco::PFCandidateCollection > transferFakeMuonCleanedCandidates() {
184  }
185 
187  std::auto_ptr< reco::PFCandidateCollection > transferPunchThroughMuonCleanedCandidates() {
189  }
190 
192  std::auto_ptr< reco::PFCandidateCollection > transferPunchThroughHadronCleanedCandidates() {
194  }
195 
197  std::auto_ptr< reco::PFCandidateCollection > transferAddedMuonCandidates() {
198  return pfAddedMuonCandidates_;
199  }
200 
202  std::auto_ptr< reco::PFCandidateCollection > transferCandidates() {
204  }
205 
206  friend std::ostream& operator<<(std::ostream& out, const PFAlgo& algo);
207 
208  protected:
209 
212  virtual void processBlock( const reco::PFBlockRef& blockref,
213  std::list<reco::PFBlockRef>& hcalBlockRefs,
214  std::list<reco::PFBlockRef>& ecalBlockRefs );
215 
218  unsigned reconstructTrack( const reco::PFBlockElement& elt );
219 
225 
226  unsigned reconstructCluster( const reco::PFCluster& cluster,
227  double particleEnergy,
228  bool useDirection = false,
229  double particleX=0.,
230  double particleY=0.,
231  double particleZ=0.);
232 
233 
235  // double gammaCalibratedEnergy( double clusterEnergy ) const;
236 
239  // double neutralHadronCalibratedEnergy( double energyHCAL,
240  // double energyECAL=-1) const;
241 
242 
244  double neutralHadronEnergyResolution( double clusterEnergy,
245  double clusterEta ) const;
246 
247 
248  double nSigmaHCAL( double clusterEnergy,
249  double clusterEta ) const;
250 
251  std::auto_ptr< reco::PFCandidateCollection > pfCandidates_;
253  std::auto_ptr< reco::PFCandidateCollection > pfElectronCandidates_;
254  // the post-HF-cleaned candidates
255  std::auto_ptr< reco::PFCandidateCollection > pfCleanedCandidates_;
257  std::auto_ptr< reco::PFCandidateCollection > pfCosmicsMuonCleanedCandidates_;
259  std::auto_ptr< reco::PFCandidateCollection > pfCleanedTrackerAndGlobalMuonCandidates_;
261  std::auto_ptr< reco::PFCandidateCollection > pfFakeMuonCleanedCandidates_;
263  std::auto_ptr< reco::PFCandidateCollection > pfPunchThroughMuonCleanedCandidates_;
265  std::auto_ptr< reco::PFCandidateCollection > pfPunchThroughHadronCleanedCandidates_;
267  std::auto_ptr< reco::PFCandidateCollection > pfAddedMuonCandidates_;
268 
271 
275  const reco::PFCluster& cluster );
276 
278  void associatePSClusters(unsigned iEcal,
279  reco::PFBlockElement::Type psElementType,
280  const reco::PFBlock& block,
282  const reco::PFBlock::LinkData& linkData,
283  std::vector<bool>& active,
284  std::vector<double>& psEne);
285 
286  bool isFromSecInt(const reco::PFBlockElement& eTrack, std::string order) const;
287 
288 
289  // Post HF Cleaning
290  void postCleaning();
291 
292 
293 
294 
295  private:
299  unsigned bi );
300 
303 
305  double nSigmaECAL_;
306 
308  double nSigmaHCAL_;
309 
310  boost::shared_ptr<PFEnergyCalibration> calibration_;
311  boost::shared_ptr<pftools::PFClusterCalibration> clusterCalibration_;
312  boost::shared_ptr<PFEnergyCalibrationHF> thepfEnergyCalibrationHF_;
313  boost::shared_ptr<PFSCEnergyCalibration> thePFSCEnergyCalibration_;
314 
315  unsigned int newCalib_;
316 
317  // std::vector<unsigned> hcalBlockUsed_;
318 
319  int algo_;
320  bool debug_;
321 
323  std::string mvaWeightFileEleID_;
324  std::vector<double> setchi2Values_;
325  double mvaEleCut_;
337  unsigned int nTrackIsoForEgammaSC_;
339 
340  // Option to let PF decide the muon momentum
342 
347 
352 
356 
357 
361 
363  std::vector<double> muonHCAL_;
364  std::vector<double> muonECAL_;
365  double nSigmaTRACK_;
366  double ptError_;
367  std::vector<double> factors45_;
368 
369  // Parameters for post HF cleaning
377  double minDeltaMet_;
378 
379  //MIKE -May19th: Add option for the vertices....
382 
383 };
384 
385 
386 #endif
387 
388 
std::auto_ptr< reco::PFCandidateCollection > transferCandidates()
Definition: PFAlgo.h:202
unsigned int nTrackIsoForEgammaSC_
Definition: PFAlgo.h:337
Abstract base class for a PFBlock element (track, cluster...)
double ptError_
Definition: PFAlgo.h:366
reconstructed track used as an input to particle flow
Definition: PFRecTrack.h:22
bool isFromSecInt(const reco::PFBlockElement &eTrack, std::string order) const
Definition: PFAlgo.cc:3064
bool usePFConversions_
Definition: PFAlgo.h:349
std::vector< double > muonHCAL_
Variables for muons and fakes.
Definition: PFAlgo.h:363
bool postMuonCleaning_
Definition: PFAlgo.h:371
std::auto_ptr< reco::PFCandidateCollection > connect(std::auto_ptr< reco::PFCandidateCollection > &pfCand)
double maxDeltaPhiPt_
Definition: PFAlgo.h:376
double maxSignificance_
Definition: PFAlgo.h:374
double sumEtEcalIsoForEgammaSC_endcap_
Definition: PFAlgo.h:332
double mvaEleCut_
Definition: PFAlgo.h:325
double minHFCleaningPt_
Definition: PFAlgo.h:372
Particle flow cluster, see clustering algorithm in PFClusterAlgo.
Definition: PFCluster.h:42
double coneEcalIsoForEgammaSC_
Definition: PFAlgo.h:333
double minDeltaMet_
Definition: PFAlgo.h:377
double minSignificance_
Definition: PFAlgo.h:373
void setCandConnectorParameters(const edm::ParameterSet &iCfgCandConnector)
Definition: PFAlgo.h:70
std::auto_ptr< reco::PFCandidateCollection > pfFakeMuonCleanedCandidates_
the collection of fake cleaned muon candidates
Definition: PFAlgo.h:261
unsigned reconstructCluster(const reco::PFCluster &cluster, double particleEnergy, bool useDirection=false, double particleX=0., double particleY=0., double particleZ=0.)
Definition: PFAlgo.cc:2772
void reconstructParticles(const reco::PFBlockHandle &blockHandle)
Definition: PFAlgo.cc:225
std::vector< double > setchi2Values_
Definition: PFAlgo.h:324
double coneTrackIsoForEgammaSC_
Definition: PFAlgo.h:336
std::auto_ptr< reco::PFCandidateElectronExtraCollection > transferElectronExtra()
Definition: PFAlgo.h:159
double nSigmaHCAL_
number of sigma to judge energy excess in HCAL
Definition: PFAlgo.h:308
std::map< unsigned int, Link > LinkData
Definition: PFBlock.h:46
std::auto_ptr< reco::PFCandidateCollection > transferFakeMuonCleanedCandidates()
Definition: PFAlgo.h:182
virtual void processBlock(const reco::PFBlockRef &blockref, std::list< reco::PFBlockRef > &hcalBlockRefs, std::list< reco::PFBlockRef > &ecalBlockRefs)
Definition: PFAlgo.cc:351
list elements
Definition: asciidump.py:414
std::vector< Vertex > VertexCollection
collection of Vertex objects
Definition: VertexFwd.h:9
std::vector< PFRecHit > PFRecHitCollection
collection of PFRecHit objects
Definition: PFRecHitFwd.h:9
void checkCleaning(const reco::PFRecHitCollection &cleanedHF)
Check HF Cleaning.
Definition: PFAlgo.cc:3213
PFCandConnector connector_
Definition: PFAlgo.h:360
void setDisplacedVerticesParameters(bool rejectTracks_Bad, bool rejectTracks_Step45, bool usePFNuclearInteractions, bool usePFConversions, bool usePFDecays, double dptRel_DispVtx)
Definition: PFAlgo.cc:186
double sumEtEcalIsoForEgammaSC_barrel_
Definition: PFAlgo.h:331
PFElectronAlgo * pfele_
Definition: PFAlgo.h:338
std::auto_ptr< reco::PFCandidateCollection > pfCleanedCandidates_
Definition: PFAlgo.h:255
void setEGElectronCollection(const reco::GsfElectronCollection &egelectrons)
Definition: PFAlgo.cc:3095
std::vector< GsfElectron > GsfElectronCollection
collection of GsfElectron objects
bool rejectTracks_Step45_
Definition: PFAlgo.h:346
double minSignificanceReduction_
Definition: PFAlgo.h:375
std::vector< double > factors45_
Definition: PFAlgo.h:367
PFConversionAlgo * pfConversion_
Definition: PFAlgo.h:350
void setPFEleParameters(double mvaEleCut, std::string mvaWeightFileEleID, bool usePFElectrons, const boost::shared_ptr< PFSCEnergyCalibration > &thePFSCEnergyCalibration, double sumEtEcalIsoForEgammaSC_barrel, double sumEtEcalIsoForEgammaSC_endcap, double coneEcalIsoForEgammaSC, double sumPtTrackIsoForEgammaSC_barrel, double sumPtTrackIsoForEgammaSC_endcap, unsigned int nTrackIsoForEgammaSC, double coneTrackIsoForEgammaSC, bool applyCrackCorrections=false, bool usePFSCEleCalib=true, bool useEGElectrons=false, bool useEGammaSupercluster=true)
Definition: PFAlgo.cc:93
int algo_
Definition: PFAlgo.h:319
bool useEGammaSupercluster_
Definition: PFAlgo.h:330
boost::shared_ptr< pftools::PFClusterCalibration > clusterCalibration_
Definition: PFAlgo.h:311
bool usePFNuclearInteractions_
Definition: PFAlgo.h:348
bool postHFCleaning_
Definition: PFAlgo.h:370
void setDebug(bool debug)
Definition: PFAlgo.h:61
Based on a class from : V. Roberfroid, February 2008.
std::auto_ptr< reco::PFCandidateCollection > transferPunchThroughHadronCleanedCandidates()
Definition: PFAlgo.h:192
bool useEGElectrons_
Definition: PFAlgo.h:329
void associatePSClusters(unsigned iEcal, reco::PFBlockElement::Type psElementType, const reco::PFBlock &block, const edm::OwnVector< reco::PFBlockElement > &elements, const reco::PFBlock::LinkData &linkData, std::vector< bool > &active, std::vector< double > &psEne)
Associate PS clusters to a given ECAL cluster, and return their energy.
Definition: PFAlgo.cc:3009
std::string mvaWeightFileEleID_
Variables for PFElectrons.
Definition: PFAlgo.h:323
tuple result
Definition: query.py:137
std::auto_ptr< reco::PFCandidateCollection > transferPunchThroughMuonCleanedCandidates()
Definition: PFAlgo.h:187
std::auto_ptr< reco::PFCandidateCollection > transferElectronCandidates()
Definition: PFAlgo.h:153
bool usePFMuonMomAssign_
Definition: PFAlgo.h:341
reco::Vertex primaryVertex_
Definition: PFAlgo.h:380
double nSigmaHCAL(double clusterEnergy, double clusterEta) const
Definition: PFAlgo.cc:2908
bool usePFSCEleCalib_
Definition: PFAlgo.h:328
std::vector< double > muonECAL_
Definition: PFAlgo.h:364
void setPostHFCleaningParameters(bool postHFCleaning, double minHFCleaningPt, double minSignificance, double maxSignificance, double minSignificanceReduction, double maxDeltaPhiPt, double minDeltaMet)
Definition: PFAlgo.cc:169
block
Formating index page&#39;s pieces.
Definition: Association.py:187
std::vector< PFBlock > PFBlockCollection
collection of PFBlock objects
Definition: PFBlockFwd.h:11
void setPFMuonAndFakeParameters(std::vector< double > muonHCAL, std::vector< double > muonECAL, double nSigmaTRACK, double ptError, std::vector< double > factors45, bool usePFMuonMomAssign)
Definition: PFAlgo.cc:153
reco::PFBlockRef createBlockRef(const reco::PFBlockCollection &blocks, unsigned bi)
Definition: PFAlgo.cc:2997
tuple out
Definition: dbtoconf.py:99
bool isSatelliteCluster(const reco::PFRecTrack &track, const reco::PFCluster &cluster)
Definition: PFAlgo.cc:2950
void setPFVertexParameters(bool useVertex, const reco::VertexCollection &primaryVertices)
Definition: PFAlgo.cc:205
bool useVertices_
Definition: PFAlgo.h:381
void setParameters(double nSigmaECAL, double nSigmaHCAL, const boost::shared_ptr< PFEnergyCalibration > &calibration, const boost::shared_ptr< pftools::PFClusterCalibration > &clusterCalibration, const boost::shared_ptr< PFEnergyCalibrationHF > &thepfEnergyCalibrationHF, unsigned int newCalib)
Definition: PFAlgo.cc:73
std::auto_ptr< reco::PFCandidateCollection > pfCosmicsMuonCleanedCandidates_
the collection of cosmics cleaned muon candidates
Definition: PFAlgo.h:257
double dptRel_DispVtx_
Definition: PFAlgo.h:355
boost::shared_ptr< PFEnergyCalibration > calibration_
Definition: PFAlgo.h:310
reco::PFBlockHandle blockHandle_
input block handle (full framework case)
Definition: PFAlgo.h:302
std::auto_ptr< reco::PFCandidateCollection > transferCleanedTrackerAndGlobalMuonCandidates()
Definition: PFAlgo.h:177
void setCandConnectorParameters(bool bCorrect, bool bCalibPrimary, double dptRel_PrimaryTrack, double dptRel_MergedTrack, double ptErrorSecondary, std::vector< double > nuclCalibFactors)
Definition: PFAlgo.h:74
boost::shared_ptr< PFSCEnergyCalibration > thePFSCEnergyCalibration_
Definition: PFAlgo.h:313
std::auto_ptr< reco::PFCandidateCollection > pfPunchThroughHadronCleanedCandidates_
the collection of punch-through cleaned neutral hadron candidates
Definition: PFAlgo.h:265
virtual ~PFAlgo()
destructor
Definition: PFAlgo.cc:66
std::auto_ptr< reco::PFCandidateCollection > & transferCleanedCandidates()
Definition: PFAlgo.h:167
std::auto_ptr< reco::PFCandidateCollection > pfCleanedTrackerAndGlobalMuonCandidates_
the collection of tracker/global cleaned muon candidates
Definition: PFAlgo.h:259
boost::shared_ptr< PFEnergyCalibrationHF > thepfEnergyCalibrationHF_
Definition: PFAlgo.h:312
bool rejectTracks_Bad_
Definition: PFAlgo.h:345
PFAlgo()
constructor
Definition: PFAlgo.cc:56
std::auto_ptr< reco::PFCandidateCollection > pfCandidates_
Definition: PFAlgo.h:251
void postMuonCleaning(const edm::Handle< reco::MuonCollection > &muonh, const reco::VertexCollection &primaryVertices)
Definition: PFAlgo.cc:3320
std::auto_ptr< reco::PFCandidateCollection > transferAddedMuonCandidates()
Definition: PFAlgo.h:197
bool debug_
Definition: PFAlgo.h:320
bool applyCrackCorrectionsElectrons_
Definition: PFAlgo.h:327
void setParameters(const edm::ParameterSet &iCfgCandConnector)
double sumPtTrackIsoForEgammaSC_endcap_
Definition: PFAlgo.h:335
double nSigmaTRACK_
Definition: PFAlgo.h:365
unsigned reconstructTrack(const reco::PFBlockElement &elt)
Definition: PFAlgo.cc:2589
std::auto_ptr< reco::PFCandidateCollection > pfPunchThroughMuonCleanedCandidates_
the collection of punch-through cleaned muon candidates
Definition: PFAlgo.h:263
std::auto_ptr< reco::PFCandidateCollection > pfElectronCandidates_
the unfiltered electron collection
Definition: PFAlgo.h:253
#define debug
Definition: MEtoEDMFormat.h:34
unsigned int newCalib_
Definition: PFAlgo.h:315
double neutralHadronEnergyResolution(double clusterEnergy, double clusterEta) const
todo: use PFClusterTools for this
Definition: PFAlgo.cc:2884
void postCleaning()
Definition: PFAlgo.cc:3100
std::vector< reco::PFCandidateElectronExtra > PFCandidateElectronExtraCollection
collection of PFCandidateElectronExtras
std::auto_ptr< reco::PFCandidateCollection > pfAddedMuonCandidates_
the collection of added muon candidates
Definition: PFAlgo.h:267
reco::PFCandidateElectronExtraCollection pfElectronExtra_
the unfiltered electron collection
Definition: PFAlgo.h:270
Definition: PFAlgo.h:49
bool usePFDecays_
Definition: PFAlgo.h:351
std::auto_ptr< reco::PFCandidateCollection > transferCosmicsMuonCleanedCandidates()
Definition: PFAlgo.h:172
void setDebug(bool debug)
void setAlgo(int algo)
Definition: PFAlgo.h:59
double sumPtTrackIsoForEgammaSC_barrel_
Definition: PFAlgo.h:334
const std::auto_ptr< reco::PFCandidateCollection > & pfCandidates() const
Definition: PFAlgo.h:148
friend std::ostream & operator<<(std::ostream &out, const PFAlgo &algo)
void setElectronExtraRef(const edm::OrphanHandle< reco::PFCandidateElectronExtraCollection > &extrah)
Definition: PFAlgo.cc:3798
double nSigmaECAL_
number of sigma to judge energy excess in ECAL
Definition: PFAlgo.h:305
Block of elements.
Definition: PFBlock.h:30
bool usePFElectrons_
Definition: PFAlgo.h:326