CMS 3D CMS Logo

PFClusterTimeSelector.cc
Go to the documentation of this file.
2 #include <memory>
3 
7 
8 using namespace std;
9 using namespace edm;
10 
12  : clusters_(consumes<reco::PFClusterCollection>(iConfig.getParameter<edm::InputTag>("src"))) {
13  std::vector<edm::ParameterSet> cuts = iConfig.getParameter<std::vector<edm::ParameterSet> >("cuts");
14  for (const auto& cut : cuts) {
15  CutInfo info;
16  info.depth = cut.getParameter<double>("depth");
17  info.minE = cut.getParameter<double>("minEnergy");
18  info.maxE = cut.getParameter<double>("maxEnergy");
19  info.minTime = cut.getParameter<double>("minTime");
20  info.maxTime = cut.getParameter<double>("maxTime");
21  info.endcap = cut.getParameter<bool>("endcap");
22  cutInfo_.push_back(info);
23  }
24 
25  produces<reco::PFClusterCollection>();
26  produces<reco::PFClusterCollection>("OOT");
27 }
28 
31  iEvent.getByToken(clusters_, clusters);
32  auto out = std::make_unique<reco::PFClusterCollection>();
33  auto outOOT = std::make_unique<reco::PFClusterCollection>();
34 
35  for (const auto& cluster : *clusters) {
36  const double energy = cluster.energy();
37  const double time = cluster.time();
38  const double depth = cluster.depth();
39  const PFLayer::Layer layer = cluster.layer();
40  for (const auto& info : cutInfo_) {
41  if (energy < info.minE || energy > info.maxE)
42  continue;
43  if (depth < 0.9 * info.depth || depth > 1.1 * info.depth)
44  continue;
45  if ((info.endcap &&
46  (layer == PFLayer::ECAL_BARREL || layer == PFLayer::HCAL_BARREL1 || layer == PFLayer::HCAL_BARREL2)) ||
47  (((!info.endcap) && (layer == PFLayer::ECAL_ENDCAP || layer == PFLayer::HCAL_ENDCAP))))
48  continue;
49 
50  if (time > info.minTime && time < info.maxTime)
51  out->push_back(cluster);
52  else
53  outOOT->push_back(cluster);
54 
55  break;
56  }
57  }
58 
59  iEvent.put(std::move(out));
60  iEvent.put(std::move(outOOT), "OOT");
61 }
62 
64 
65 // ------------ method called once each job just before starting event loop ------------
MessageLogger.h
TkAlMuonSelectors_cfi.cut
cut
Definition: TkAlMuonSelectors_cfi.py:5
ESHandle.h
edm::Run
Definition: Run.h:45
edm
HLT enums.
Definition: AlignableModifier.h:19
PFClusterTimeSelector::PFClusterTimeSelector
PFClusterTimeSelector(const edm::ParameterSet &)
Definition: PFClusterTimeSelector.cc:11
PFLayer::HCAL_ENDCAP
Definition: PFLayer.h:37
info
static const TGPicture * info(bool iBackgroundIsBlack)
Definition: FWCollectionSummaryWidget.cc:153
reco
fixed size matrix
Definition: AlignmentAlgorithmBase.h:45
edm::Handle
Definition: AssociativeIterator.h:50
PFLayer::ECAL_BARREL
Definition: PFLayer.h:33
PFClusterTimeSelector::produce
void produce(edm::Event &iEvent, const edm::EventSetup &iSetup) override
Definition: PFClusterTimeSelector.cc:29
PFLayer::HCAL_BARREL2
Definition: PFLayer.h:36
PFLayer::HCAL_BARREL1
Definition: PFLayer.h:35
PFClusterTimeSelector::cutInfo_
std::vector< CutInfo > cutInfo_
Definition: PFClusterTimeSelector.h:39
HCALHighEnergyHPDFilter_cfi.energy
energy
Definition: HCALHighEnergyHPDFilter_cfi.py:5
LEDCalibrationChannels.depth
depth
Definition: LEDCalibrationChannels.py:65
PFLayer::Layer
Layer
layer definition
Definition: PFLayer.h:29
bsc_activity_cfg.clusters
clusters
Definition: bsc_activity_cfg.py:36
edm::ParameterSet
Definition: ParameterSet.h:47
PFClusterTimeSelector::beginRun
void beginRun(const edm::Run &run, const edm::EventSetup &es) override
Definition: PFClusterTimeSelector.cc:66
PFClusterTimeSelector::clusters_
edm::EDGetTokenT< reco::PFClusterCollection > clusters_
Definition: PFClusterTimeSelector.h:38
iEvent
int iEvent
Definition: GenABIO.cc:224
edm::EventSetup
Definition: EventSetup.h:57
eostools.move
def move(src, dest)
Definition: eostools.py:511
std
Definition: JetResolutionObject.h:76
writedatasetfile.run
run
Definition: writedatasetfile.py:27
PFClusterTimeSelector::~PFClusterTimeSelector
~PFClusterTimeSelector() override
EventSetup.h
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
PFClusterTimeSelector::CutInfo
Definition: PFClusterTimeSelector.h:28
MillePedeFileConverter_cfg.out
out
Definition: MillePedeFileConverter_cfg.py:31
L1TMuonDQMOffline_cfi.cuts
cuts
Definition: L1TMuonDQMOffline_cfi.py:41
ntuplemaker.time
time
Definition: ntuplemaker.py:310
PFLayer::ECAL_ENDCAP
Definition: PFLayer.h:32
edm::Event
Definition: Event.h:73
l1t::PFClusterCollection
std::vector< l1t::PFCluster > PFClusterCollection
Definition: PFCluster.h:73
edm::InputTag
Definition: InputTag.h:15
PFClusterTimeSelector.h