-
Notifications
You must be signed in to change notification settings - Fork 4.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add in code for ecal cluster time assigner
- Loading branch information
Showing
7 changed files
with
92 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
RecoParticleFlow/PFSimProducer/plugins/ConfigurableFlatResolutionModel.cc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#include "ResolutionModel.h" | ||
|
||
class ConfigurableFlatResolutionModel : public ResolutionModel { | ||
public: | ||
ConfigurableFlatResolutionModel( const edm::ParameterSet& conf ) : | ||
ResolutionModel( conf ), | ||
reso_( conf.getParameter<double>("resolutionInNs") ) { | ||
} | ||
|
||
virtual float getTimeResolution(const reco::Track&) const override { return reso_; } | ||
virtual float getTimeResolution(const reco::PFCluster&) const override { return reso_; } | ||
|
||
private: | ||
const float reso_; | ||
}; | ||
|
||
DEFINE_EDM_PLUGIN(ResolutionModelFactory, | ||
ConfigurableFlatResolutionModel, | ||
"ConfigurableFlatResolutionModel"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
RecoParticleFlow/PFSimProducer/plugins/PerfectResolutionModel.cc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#include "ResolutionModel.h" | ||
|
||
class PerfectResolutionModel : public ResolutionModel { | ||
public: | ||
PerfectResolutionModel( const edm::ParameterSet& conf ) : ResolutionModel( conf ) {} | ||
|
||
virtual float getTimeResolution(const reco::Track&) const override { return 1e-6; } | ||
virtual float getTimeResolution(const reco::PFCluster&) const override { return 1e-6; } | ||
|
||
}; | ||
|
||
DEFINE_EDM_PLUGIN(ResolutionModelFactory, | ||
PerfectResolutionModel, | ||
"PerfectResolutionModel"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#include "ResolutionModel.h" | ||
|
||
EDM_REGISTER_PLUGINFACTORY(ResolutionModelFactory, | ||
"ResolutionModelFactory"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
#ifndef __RecoFTL_FastTimingKludge_ResolutionModel_h__ | ||
#define __RecoFTL_FastTimingKludge_ResolutionModel_h__ | ||
|
||
#include "FWCore/ParameterSet/interface/ParameterSet.h" | ||
#include "DataFormats/TrackReco/interface/Track.h" | ||
#include "DataFormats/ParticleFlowReco/interface/PFCluster.h" | ||
|
||
#include <string> | ||
#include <iostream> | ||
|
||
class ResolutionModel { | ||
public: | ||
ResolutionModel(const edm::ParameterSet& conf): | ||
_modelName(conf.getParameter<std::string>("modelName")) { | ||
} | ||
virtual ~ResolutionModel() { } | ||
// get rid of things we should never use... | ||
ResolutionModel(const ResolutionModel&) = delete; | ||
ResolutionModel& operator=(const ResolutionModel&) = delete; | ||
|
||
virtual float getTimeResolution(const reco::Track&) const { return -1.f; } | ||
virtual float getTimeResolution(const reco::PFCluster&) const { return -1.f; } | ||
|
||
const std::string& name() const { return _modelName; } | ||
|
||
private: | ||
const std::string _modelName; | ||
}; | ||
|
||
#include "FWCore/PluginManager/interface/PluginFactory.h" | ||
typedef edmplugin::PluginFactory< ResolutionModel* (const edm::ParameterSet&) > ResolutionModelFactory; | ||
|
||
#endif |
12 changes: 12 additions & 0 deletions
12
RecoParticleFlow/PFSimProducer/python/ecalBarrelClusterFastTimer_cfi.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import FWCore.ParameterSet.Config as cms | ||
|
||
ecalBarrelClusterFastTimer = cms.EDProducer( | ||
'EcalBarrelClusterFastTimer', | ||
ebTimeHits = cms.InputTag('ecalDetailedTimeRecHit:EcalRecHitsEB'), | ||
ebClusters = cms.InputTag('particleFlowClusterECAL'), | ||
timedVertices = cms.InputTag('offlinePrimaryVertices4D'), | ||
minFractionToConsider = cms.double(0.1), | ||
minEnergyToConsider = cms.double(0.0), | ||
ecalDepth = cms.double(7.0), | ||
resolutionModels = cms.VPSet( cms.PSet( modelName = cms.string('PerfectResolutionModel') ) ) | ||
) |