CMS 3D CMS Logo

TotemRPRecHitProducer.cc
Go to the documentation of this file.
1 /****************************************************************************
2 *
3 * This is a part of TOTEM offline software.
4 * Authors:
5 * Hubert Niewiadomski
6 * Jan Kašpar (jan.kaspar@gmail.com)
7 *
8 ****************************************************************************/
9 
11 
16 
21 
23 
24 //----------------------------------------------------------------------------------------------------
25 
27 public:
28  explicit TotemRPRecHitProducer(const edm::ParameterSet& conf);
29 
30  ~TotemRPRecHitProducer() override {}
31 
32  void produce(edm::Event& e, const edm::EventSetup& c) override;
34 
35 private:
37  int verbosity_;
38 
40 
43 };
44 
45 //----------------------------------------------------------------------------------------------------
46 //----------------------------------------------------------------------------------------------------
47 
48 using namespace std;
49 using namespace edm;
50 
51 //----------------------------------------------------------------------------------------------------
52 
53 TotemRPRecHitProducer::TotemRPRecHitProducer(const edm::ParameterSet& conf) : conf_(conf), algorithm_(conf) {
54  verbosity_ = conf.getParameter<int>("verbosity");
55 
56  tagCluster_ = conf.getParameter<edm::InputTag>("tagCluster");
57  tokenCluster_ = consumes<edm::DetSetVector<TotemRPCluster>>(tagCluster_);
58 
59  produces<edm::DetSetVector<TotemRPRecHit>>();
60 }
61 
62 //----------------------------------------------------------------------------------------------------
63 
65  // get input
67  e.getByToken(tokenCluster_, input);
68 
69  // prepare output
71 
72  // build reco hits
73  for (auto& ids : *input) {
74  DetSet<TotemRPRecHit>& ods = output.find_or_insert(ids.detId());
75  algorithm_.buildRecoHits(ids, ods);
76  }
77 
78  // save output
79  e.put(make_unique<DetSetVector<TotemRPRecHit>>(output));
80 }
81 
82 //----------------------------------------------------------------------------------------------------
83 
86 
87  desc.add<edm::InputTag>("tagCluster", edm::InputTag("totemRPClusterProducer"))
88  ->setComment("input clusters collection to retrieve");
89  desc.add<int>("verbosity", 0);
90 
91  descr.add("totemRPRecHitProducer", desc);
92 }
93 
94 //----------------------------------------------------------------------------------------------------
95 
TotemRPRecHitProducer::fillDescriptions
static void fillDescriptions(edm::ConfigurationDescriptions &)
Definition: TotemRPRecHitProducer.cc:84
edm::DetSetVector< TotemRPRecHit >
edm::ParameterSetDescription::add
ParameterDescriptionBase * add(U const &iLabel, T const &value)
Definition: ParameterSetDescription.h:95
input
static const std::string input
Definition: EdmProvDump.cc:48
TotemRPRecHitProducer::~TotemRPRecHitProducer
~TotemRPRecHitProducer() override
Definition: TotemRPRecHitProducer.cc:36
edm::DetSet
Definition: DetSet.h:23
convertSQLitetoXML_cfg.output
output
Definition: convertSQLitetoXML_cfg.py:32
edm::EDGetTokenT
Definition: EDGetToken.h:33
edm
HLT enums.
Definition: AlignableModifier.h:19
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
TotemRPRecHitProducerAlgorithm.h
EDProducer.h
TotemRPRecHit.h
TotemRPRecHitProducer::tagCluster_
edm::InputTag tagCluster_
Definition: TotemRPRecHitProducer.cc:47
TotemRPCluster.h
edm::Handle
Definition: AssociativeIterator.h:50
TotemRPRecHitProducer::algorithm_
TotemRPRecHitProducerAlgorithm algorithm_
Definition: TotemRPRecHitProducer.cc:45
MakerMacros.h
DEFINE_FWK_MODULE
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
edm::ConfigurationDescriptions::add
void add(std::string const &label, ParameterSetDescription const &psetDescription)
Definition: ConfigurationDescriptions.cc:57
TotemRPRecHitProducerAlgorithm::buildRecoHits
void buildRecoHits(const edm::DetSet< TotemRPCluster > &input, edm::DetSet< TotemRPRecHit > &output)
Definition: TotemRPRecHitProducerAlgorithm.cc:13
TotemRPRecHitProducer::conf_
const edm::ParameterSet conf_
Definition: TotemRPRecHitProducer.cc:42
TotemRPRecHitProducer::TotemRPRecHitProducer
TotemRPRecHitProducer(const edm::ParameterSet &conf)
Definition: TotemRPRecHitProducer.cc:53
TotemRPRecHitProducer::tokenCluster_
edm::EDGetTokenT< edm::DetSetVector< TotemRPCluster > > tokenCluster_
Definition: TotemRPRecHitProducer.cc:48
edm::ConfigurationDescriptions
Definition: ConfigurationDescriptions.h:28
HLT_2018_cff.InputTag
InputTag
Definition: HLT_2018_cff.py:79016
edm::ParameterSet
Definition: ParameterSet.h:36
TotemRPRecHitProducer::verbosity_
int verbosity_
Definition: TotemRPRecHitProducer.cc:43
Event.h
edm::stream::EDProducer
Definition: EDProducer.h:38
edm::EventSetup
Definition: EventSetup.h:57
DetSetVector.h
HltBtagPostValidation_cff.c
c
Definition: HltBtagPostValidation_cff.py:31
TotemRPRecHitProducer::produce
void produce(edm::Event &e, const edm::EventSetup &c) override
Definition: TotemRPRecHitProducer.cc:64
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
std
Definition: JetResolutionObject.h:76
TotemRPRecHitProducerAlgorithm
Definition: TotemRPRecHitProducerAlgorithm.h:20
TotemRPRecHitProducer
Definition: TotemRPRecHitProducer.cc:26
EventSetup.h
DetSet.h
ParameterSet.h
edm::Event
Definition: Event.h:73
edm::InputTag
Definition: InputTag.h:15
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37