CMS 3D CMS Logo

TotemRPClusterProducer.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 
20 
22 
23 //----------------------------------------------------------------------------------------------------
24 
29 public:
30  explicit TotemRPClusterProducer(const edm::ParameterSet& conf);
31 
32  ~TotemRPClusterProducer() override {}
33 
34  void produce(edm::Event& e, const edm::EventSetup& c) override;
36 
37 private:
39  int verbosity_;
42 
44 
46 };
47 
48 //----------------------------------------------------------------------------------------------------
49 //----------------------------------------------------------------------------------------------------
50 
51 using namespace std;
52 using namespace edm;
53 
54 //----------------------------------------------------------------------------------------------------
55 
56 TotemRPClusterProducer::TotemRPClusterProducer(edm::ParameterSet const& conf) : conf_(conf), algorithm_(conf) {
57  verbosity_ = conf.getParameter<int>("verbosity");
58 
59  digiInputTag_ = conf.getParameter<edm::InputTag>("tagDigi");
60  digiInputTagToken_ = consumes<edm::DetSetVector<TotemRPDigi>>(digiInputTag_);
61 
62  produces<edm::DetSetVector<TotemRPCluster>>();
63 }
64 
65 //----------------------------------------------------------------------------------------------------
66 
68  // get input
70  e.getByToken(digiInputTagToken_, input);
71 
72  // prepare output
74 
75  // run clusterisation
76  if (!input->empty())
77  run(*input, output);
78 
79  // save output to event
80  e.put(make_unique<DetSetVector<TotemRPCluster>>(output));
81 }
82 
83 //----------------------------------------------------------------------------------------------------
84 
87  for (const auto& ds_digi : input) {
88  edm::DetSet<TotemRPCluster>& ds_cluster = output.find_or_insert(ds_digi.id);
89 
90  algorithm_.buildClusters(ds_digi.id, ds_digi.data, ds_cluster.data);
91  }
92 }
93 
94 //----------------------------------------------------------------------------------------------------
95 
98 
99  desc.add<edm::InputTag>("tagDigi", edm::InputTag("totemRPRawToDigi", "TrackingStrip"))
100  ->setComment("input digis collection to retrieve");
101  desc.add<int>("verbosity", 0);
102 
103  descr.add("totemRPClusterProducer", desc);
104 }
105 
106 //----------------------------------------------------------------------------------------------------
107 
edm::DetSetVector
Definition: DetSetVector.h:61
input
static const std::string input
Definition: EdmProvDump.cc:48
edm::DetSet
Definition: DetSet.h:23
convertSQLitetoXML_cfg.output
output
Definition: convertSQLitetoXML_cfg.py:72
edm::EDGetTokenT
Definition: EDGetToken.h:33
edm
HLT enums.
Definition: AlignableModifier.h:19
HLT_FULL_cff.InputTag
InputTag
Definition: HLT_FULL_cff.py:89301
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
EDProducer.h
TotemRPClusterProducer::digiInputTagToken_
edm::EDGetTokenT< edm::DetSetVector< TotemRPDigi > > digiInputTagToken_
Definition: TotemRPClusterProducer.cc:47
TotemRPClusterProducer::produce
void produce(edm::Event &e, const edm::EventSetup &c) override
Definition: TotemRPClusterProducer.cc:67
edm::Handle
Definition: AssociativeIterator.h:50
MakerMacros.h
TotemRPClusterProducer::algorithm_
TotemRPClusterProducerAlgorithm algorithm_
Definition: TotemRPClusterProducer.cc:49
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
TotemRPClusterProducerAlgorithm.h
edm::ConfigurationDescriptions
Definition: ConfigurationDescriptions.h:28
edm::ParameterSet
Definition: ParameterSet.h:47
TotemRPClusterProducer::~TotemRPClusterProducer
~TotemRPClusterProducer() override
Definition: TotemRPClusterProducer.cc:38
Event.h
TotemRPClusterProducerAlgorithm::buildClusters
int buildClusters(unsigned int detId, const std::vector< TotemRPDigi > &digi, std::vector< TotemRPCluster > &clusters)
Definition: TotemRPClusterProducerAlgorithm.cc:25
edm::stream::EDProducer
Definition: EDProducer.h:36
edm::EventSetup
Definition: EventSetup.h:58
DetSetVector.h
TotemRPClusterProducer::TotemRPClusterProducer
TotemRPClusterProducer(const edm::ParameterSet &conf)
Definition: TotemRPClusterProducer.cc:56
TotemRPClusterProducer
Definition: TotemRPClusterProducer.cc:28
TotemRPClusterProducer::run
void run(const edm::DetSetVector< TotemRPDigi > &input, edm::DetSetVector< TotemRPCluster > &output)
Definition: TotemRPClusterProducer.cc:85
TotemRPClusterProducer::fillDescriptions
static void fillDescriptions(edm::ConfigurationDescriptions &)
Definition: TotemRPClusterProducer.cc:96
TotemRPClusterProducer::conf_
edm::ParameterSet conf_
Definition: TotemRPClusterProducer.cc:44
TotemRPClusterProducer::digiInputTag_
edm::InputTag digiInputTag_
Definition: TotemRPClusterProducer.cc:46
submitPVResolutionJobs.desc
string desc
Definition: submitPVResolutionJobs.py:251
TotemRPClusterProducerAlgorithm
Definition: TotemRPClusterProducerAlgorithm.h:21
std
Definition: JetResolutionObject.h:76
edm::DetSet::data
collection_type data
Definition: DetSet.h:80
EventSetup.h
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
DetSet.h
ParameterSet.h
TotemRPDigi.h
c
auto & c
Definition: CAHitNtupletGeneratorKernelsImpl.h:56
edm::Event
Definition: Event.h:73
edm::InputTag
Definition: InputTag.h:15
TotemRPClusterProducer::verbosity_
int verbosity_
Definition: TotemRPClusterProducer.cc:45
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37